Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/patch.py @ 7732:3793802ea41b
Make util.find_exe alway returns existing file, fixing issue1459
It seems like the old behaviour with different handling for commands with and
without path was intended, but I think this behaviour of util.find_exe is
better:
* Always returns existing file
* or None if command not found - no default
* Windows: Returned file thus always ends with extension from PATHEXT
This fixes http://www.selenic.com/mercurial/bts/issue1459. The change might
fix other unintended behaviour too.
author | Mads Kiilerich <mads@kiilerich.com> |
---|---|
date | Sun, 25 Jan 2009 21:20:13 +0100 |
parents | e5f445c94226 |
children | edcb56991afe |
comparison
equal
deleted
inserted
replaced
7731:737f274d1915 | 7732:3793802ea41b |
---|---|
1135 files) | 1135 files) |
1136 else: | 1136 else: |
1137 try: | 1137 try: |
1138 return internalpatch(patchname, ui, strip, cwd, files) | 1138 return internalpatch(patchname, ui, strip, cwd, files) |
1139 except NoHunks: | 1139 except NoHunks: |
1140 patcher = util.find_exe('gpatch') or util.find_exe('patch') | 1140 patcher = util.find_exe('gpatch') or util.find_exe('patch') or 'patch' |
1141 ui.debug(_('no valid hunks found; trying with %r instead\n') % | 1141 ui.debug(_('no valid hunks found; trying with %r instead\n') % |
1142 patcher) | 1142 patcher) |
1143 if util.needbinarypatch(): | 1143 if util.needbinarypatch(): |
1144 args.append('--binary') | 1144 args.append('--binary') |
1145 return externalpatch(patcher, args, patchname, ui, strip, cwd, | 1145 return externalpatch(patcher, args, patchname, ui, strip, cwd, |