~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to patch.py

  • Committer: Aaron Bentley
  • Date: 2006-03-18 23:29:32 UTC
  • Revision ID: aaron.bentley@utoronto.ca-20060318232932-4981a8efa6e028c9
Fixed patch on checkouts

Show diffs side-by-side

added added

removed removed

Lines of Context:
232
232
    bzr_tags_proc.flush( )
233
233
    bzr_tags_proc.apply( )
234
234
 
235
 
def patch(branch, location, strip, legacy):
 
235
def patch(tree, location, strip, legacy):
236
236
    """Apply a patch to a branch, using patch(1).  URLs may be used."""
237
237
    my_file = None
238
238
    if location is None:
246
246
            my_file = get_transport(loc_start).get(path[1:])
247
247
        if my_file is None:
248
248
            my_file = file(location, 'rb')
249
 
    cmd = ['patch', '--directory', branch.base, '--strip', str(strip)]
 
249
    cmd = ['patch', '--directory', tree.basedir, '--strip', str(strip)]
250
250
    r = 0
251
251
    if legacy:
252
252
        child_proc = Popen(cmd, stdin=PIPE)
257
257
    else:
258
258
 
259
259
        do_patch(sys.stdin.readlines( ))
260
 
    return r
 
 
b'\\ No newline at end of file'
 
260
    return r