# HG changeset patch # User Patrick Mezard # Date 1286655188 18000 # Node ID 9ad16d1bce4bfb6a347ed4062bea9a12a963fbb4 # Parent 9b324c5e62733691e9099bb0eb25995f81b65f17 patch: simplify externalpatch() arguments diff -r 9b324c5e6273 -r 9ad16d1bce4b mercurial/patch.py --- a/mercurial/patch.py Sat Oct 09 15:13:08 2010 -0500 +++ b/mercurial/patch.py Sat Oct 09 15:13:08 2010 -0500 @@ -1169,11 +1169,12 @@ 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 @@ 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)