~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to patch.py

  • Committer: Aaron Bentley
  • Date: 2007-01-15 15:19:20 UTC
  • Revision ID: abentley@panoramicfeedback.com-20070115151920-pb4eto22dzk34co2
Add --silent option to patch

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
from bzrlib.workingtree import WorkingTree
23
23
import bzrlib.add
24
24
 
25
 
def patch(tree, location, strip):
 
25
def patch(tree, location, strip, quiet=False):
26
26
    """Apply a patch to a branch, using patch(1).  URLs may be used."""
27
27
    my_file = None
28
28
    if location is None:
32
32
        dirname, basename = urlutils.split(location)
33
33
        my_file = get_transport(dirname).get(basename)
34
34
    cmd = ['patch', '--directory', tree.basedir, '--strip', str(strip)]
 
35
    if quiet:
 
36
        cmd.append('--quiet')
35
37
    r = 0
36
38
    child_proc = Popen(cmd, stdin=PIPE)
37
39
    for line in my_file: