~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to patch.py

  • Committer: Aaron Bentley
  • Date: 2008-05-12 04:14:21 UTC
  • Revision ID: aaron@aaronbentley.com-20080512041421-hunspdyev3rxqx7u
Avoid using deprecated interface for heads

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
 
36
36
 
37
37
def run_patch(directory, patches, strip=0, reverse=False, dry_run=False,
38
 
              quiet=False, _patch_cmd='patch', target_file=None):
 
38
              quiet=False, _patch_cmd='patch'):
39
39
    args = [_patch_cmd, '-d', directory, '-s', '-p%d' % strip, '-f']
40
40
    if quiet:
41
41
        args.append('--quiet')
53
53
        stderr = subprocess.PIPE
54
54
    else:
55
55
        stderr = None
56
 
    if target_file is not None:
57
 
        args.append(target_file)
58
56
 
59
57
    try:
60
58
        process = subprocess.Popen(args, stdin=subprocess.PIPE,