# HG changeset patch # User Patrick Mezard # Date 2010-10-09 20:13:08 # Node ID 9ad16d1bce4bfb6a347ed4062bea9a12a963fbb4 # Parent 9b324c5e62733691e9099bb0eb25995f81b65f17 patch: simplify externalpatch() arguments diff --git a/mercurial/patch.py b/mercurial/patch.py --- a/mercurial/patch.py +++ b/mercurial/patch.py @@ -1169,11 +1169,12 @@ def _applydiff(ui, fp, patcher, copyfn, return -1 return err -def externalpatch(patcher, args, patchname, ui, strip, cwd, files): +def externalpatch(patcher, patchname, ui, strip, cwd, files): """use to apply to the working directory. returns whether patch was applied with fuzz factor.""" fuzz = False + args = [] if cwd: args.append('-d %s' % util.shellquote(cwd)) fp = util.popen('%s %s -p%d < %s' % (patcher, ' '.join(args), strip, @@ -1248,13 +1249,11 @@ def patch(patchname, ui, strip=1, cwd=No Returns whether patch was applied with fuzz factor. """ patcher = ui.config('ui', 'patch') - args = [] if files is None: files = {} try: if patcher: - return externalpatch(patcher, args, patchname, ui, strip, cwd, - files) + return externalpatch(patcher, patchname, ui, strip, cwd, files) return internalpatch(patchname, ui, strip, cwd, files, eolmode) except PatchError, err: s = str(err)