changeset 21191:a2f4ea82d6d3 stable

match: fix NameError 'pat' on overflow of regex pattern length 'pat' was renamed to 'regex' in 9d28fd795215.
author Yuya Nishihara <yuya@tcha.org>
date Tue, 29 Apr 2014 11:02:40 +0900
parents 2606e7f227f6
children 541b2b08f323
files mercurial/match.py tests/test-walk.t
diffstat 2 files changed, 12 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/match.py	Sun Apr 27 15:09:48 2014 +0900
+++ b/mercurial/match.py	Tue Apr 29 11:02:40 2014 +0900
@@ -343,7 +343,7 @@
             raise
         regexa, a = _buildregexmatch(kindpats[:l//2], globsuffix)
         regexb, b = _buildregexmatch(kindpats[l//2:], globsuffix)
-        return pat, lambda s: a(s) or b(s)
+        return regex, lambda s: a(s) or b(s)
     except re.error:
         for k, p in kindpats:
             try:
--- a/tests/test-walk.t	Sun Apr 27 15:09:48 2014 +0900
+++ b/tests/test-walk.t	Tue Apr 29 11:02:40 2014 +0900
@@ -331,3 +331,14 @@
   f  mammals/skunk  mammals/skunk  exact
 
   $ cd ..
+
+Test split patterns on overflow
+
+  $ cd t
+  $ echo fennel > overflow.list
+  $ python -c "for i in xrange(20000 / 100): print 'x' * 100" >> overflow.list
+  $ echo fenugreek >> overflow.list
+  $ hg debugwalk 'listfile:overflow.list' 2>&1 | grep -v '^xxx'
+  f  fennel     fennel     exact
+  f  fenugreek  fenugreek  exact
+  $ cd ..