Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/patch.py @ 4435:aac150af09e8
Add ui.patch option.
ui.patch overrides the default patch/gpatch command and options.
author | Patrick Mezard <pmezard@gmail.com> |
---|---|
date | Sat, 12 May 2007 21:09:31 +0200 |
parents | 439b1c35348a |
children | a764edb6fc95 |
comparison
equal
deleted
inserted
replaced
4434:439b1c35348a | 4435:aac150af09e8 |
---|---|
291 # helper function | 291 # helper function |
292 def __patch(patchname): | 292 def __patch(patchname): |
293 """patch and updates the files and fuzz variables""" | 293 """patch and updates the files and fuzz variables""" |
294 fuzz = False | 294 fuzz = False |
295 | 295 |
296 patcher = util.find_in_path('gpatch', os.environ.get('PATH', ''), | |
297 'patch') | |
298 args = [] | 296 args = [] |
299 if util.needbinarypatch(): | 297 patcher = ui.config('ui', 'patch') |
300 args.append('--binary') | 298 if not patcher: |
299 patcher = util.find_in_path('gpatch', os.environ.get('PATH', ''), | |
300 'patch') | |
301 if util.needbinarypatch(): | |
302 args.append('--binary') | |
301 | 303 |
302 if cwd: | 304 if cwd: |
303 args.append('-d %s' % util.shellquote(cwd)) | 305 args.append('-d %s' % util.shellquote(cwd)) |
304 fp = os.popen('%s %s -p%d < %s' % (patcher, ' '.join(args), strip, | 306 fp = os.popen('%s %s -p%d < %s' % (patcher, ' '.join(args), strip, |
305 util.shellquote(patchname))) | 307 util.shellquote(patchname))) |