# HG changeset patch # User Patrick Mezard # Date 1182265327 -7200 # Node ID 50252ea605497aca7864264ff28e2783f7f7af85 # Parent a39cec1d5cb819666f0ec7e17c586422f000f5b0 patch: fix ui.patch regression introduced by 62019c4427e3. The idea is ui.patch is either empty or wisely filled by user. diff --git a/mercurial/patch.py b/mercurial/patch.py --- a/mercurial/patch.py +++ b/mercurial/patch.py @@ -298,13 +298,14 @@ def patch(patchname, ui, strip=1, cwd=No args = [] patcher = ui.config('ui', 'patch') - patcher = ((patcher and util.find_exe(patcher)) or - util.find_exe('gpatch') or - util.find_exe('patch')) + if not patcher: + patcher = util.find_exe('gpatch') or util.find_exe('patch') + # Try to be smart only if patch call was not supplied + if util.needbinarypatch(): + args.append('--binary') + if not patcher: raise util.Abort(_('no patch command found in hgrc or PATH')) - if util.needbinarypatch(): - args.append('--binary') if cwd: args.append('-d %s' % util.shellquote(cwd))