[PATCH 3 of 3 stable] extdiff: fix wrong comment about regexp ordering - regexps are just greedy

Mads Kiilerich mads at kiilerich.com
Mon Jan 26 20:15:52 CST 2015


# HG changeset patch
# User Mads Kiilerich <madski at unity3d.com>
# Date 1422324901 -3600
#      Tue Jan 27 03:15:01 2015 +0100
# Branch stable
# Node ID 02b0b226f33ba22df7e820d27fe93a79b69ad24a
# Parent  bf99a88b77b67ac4c88674ba5d1d19dd97092426
extdiff: fix wrong comment about regexp ordering - regexps are just greedy

diff --git a/hgext/extdiff.py b/hgext/extdiff.py
--- a/hgext/extdiff.py
+++ b/hgext/extdiff.py
@@ -218,9 +218,8 @@ def dodiff(ui, repo, cmdline, pats, opts
                 return pre
             return pre + util.shellquote(replace[key])
 
-        # Match parent2 first, so 'parent1?' will match both parent1 and parent
         regex = (r'''(['"]?)([^ '"]*)?'''
-                 r'\$(parent2|parent1?|child|plabel1|plabel2|clabel|root)\1')
+                 r'\$(parent1?|parent2|child|plabel1|plabel2|clabel|root)\1')
         if not do3way and not re.search(regex, cmdline):
             cmdline += ' $parent1 $child'
         cmdline = re.sub(regex, quote, cmdline)


More information about the Mercurial-devel mailing list