changeset 12673:9ad16d1bce4b

patch: simplify externalpatch() arguments
author Patrick Mezard <pmezard@gmail.com>
date Sat, 09 Oct 2010 15:13:08 -0500
parents 9b324c5e6273
children aa2fe1f52ff4
files mercurial/patch.py
diffstat 1 files changed, 3 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- 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 <patcher> to apply <patchname> 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)