patch: simplify externalpatch() arguments
authorPatrick Mezard <pmezard@gmail.com>
Sat, 09 Oct 2010 15:13:08 -0500
changeset 12673 9ad16d1bce4b
parent 12672 9b324c5e6273
child 12674 aa2fe1f52ff4
patch: simplify externalpatch() arguments
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 <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)