# HG changeset patch # User FUJIWARA Katsunori # Date 1419518006 -32400 # Node ID 9476cb62298efa8ab0cf2a0b774821c0d6322d80 # Parent 4075f2f8ea53abb255252373e802a876d263a454 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". diff -r 4075f2f8ea53 -r 9476cb62298e 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)