~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to patch.py

  • Committer: Aaron Bentley
  • Date: 2009-10-20 22:21:59 UTC
  • Revision ID: aaron@aaronbentley.com-20091020222159-x8yo2eog4gy0v8qn
Conflict differ works with no file specified or many files specified.

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'):
 
38
              quiet=False, _patch_cmd='patch', target_file=None):
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)
56
58
 
57
59
    try:
58
60
        process = subprocess.Popen(args, stdin=subprocess.PIPE,