extdiff: rename the name of an argument for readability
authorFUJIWARA Katsunori <foozy@lares.dti.ne.jp>
Thu, 25 Dec 2014 23:33:26 +0900
changeset 23681 9476cb62298e
parent 23680 4075f2f8ea53
child 23682 1642eb429536
extdiff: rename the name of an argument for readability To reduce amount of changes for review-ability, previous patch uses "args" as argument name of "dodiff()", even though "args" includes also the name of command to be executed (or full-path of it). This patch replaces "args" by more appropriate name "cmdline".
hgext/extdiff.py
--- a/hgext/extdiff.py	Thu Dec 25 23:33:26 2014 +0900
+++ b/hgext/extdiff.py	Thu Dec 25 23:33:26 2014 +0900
@@ -109,7 +109,7 @@
                                   os.lstat(dest).st_mtime))
     return dirname, fns_and_mtime
 
-def dodiff(ui, repo, args, pats, opts):
+def dodiff(ui, repo, cmdline, pats, opts):
     '''Do the actual diff:
 
     - copy to a temp structure if diffing 2 internal revisions
@@ -120,7 +120,7 @@
 
     revs = opts.get('rev')
     change = opts.get('change')
-    do3way = '$parent2' in args
+    do3way = '$parent2' in cmdline
 
     if revs and change:
         msg = _('cannot specify --rev and --change at the same time')
@@ -219,9 +219,9 @@
 
         # Match parent2 first, so 'parent1?' will match both parent1 and parent
         regex = '\$(parent2|parent1?|child|plabel1|plabel2|clabel|root)'
-        if not do3way and not re.search(regex, args):
-            args += ' $parent1 $child'
-        cmdline = re.sub(regex, quote, args)
+        if not do3way and not re.search(regex, cmdline):
+            cmdline += ' $parent1 $child'
+        cmdline = re.sub(regex, quote, cmdline)
 
         ui.debug('running %r in %s\n' % (cmdline, tmproot))
         ui.system(cmdline, cwd=tmproot)