changeset 4184:b1716a1f79c4

util._matcher: fix handling of path: patterns
author Alexis S. L. Carvalho <alexis@cecm.usp.br>
date Sat, 10 Mar 2007 23:00:49 -0300
parents ce3ecf99a18b
children 769bc4af561d
files mercurial/util.py tests/test-walk tests/test-walk.out
diffstat 3 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/util.py
+++ b/mercurial/util.py
@@ -479,14 +479,14 @@ def _matcher(canonroot, cwd, names, inc,
             name = canonpath(canonroot, cwd, name)
             if name == '':
                 kind, name = 'glob', '**'
-        elif kind == 'relglob':
+        elif kind in ('relglob', 'path'):
             name = normpath(name)
-        if kind in ('glob', 'path', 're', 'relglob'):
+        if kind in ('glob', 're', 'relglob'):
             pats.append((kind, name))
         if kind == 'glob':
             root = globprefix(name)
             roots.append(root)
-        elif kind == 'relpath':
+        elif kind in ('relpath', 'path'):
             files.append((kind, name))
             roots.append(name)
         elif kind == 'relglob':
--- a/tests/test-walk
+++ b/tests/test-walk
@@ -48,6 +48,7 @@ hg debugwalk beans/.hg
 hg debugwalk glob:\*
 hg debugwalk 're:.*[kb]$'
 hg debugwalk path:beans/black
+hg debugwalk path:beans//black
 hg debugwalk relglob:Procyonidae
 hg debugwalk relglob:Procyonidae/ fennel
 hg debugwalk beans 'glob:beans/*'
--- a/tests/test-walk.out
+++ b/tests/test-walk.out
@@ -83,7 +83,8 @@ f  beans/black    beans/black
 f  fenugreek      fenugreek
 f  glob:glob      glob:glob
 f  mammals/skunk  mammals/skunk
-f  beans/black  beans/black
+f  beans/black  beans/black  exact
+f  beans/black  beans/black  exact
 f  mammals/Procyonidae/cacomistle  mammals/Procyonidae/cacomistle
 f  mammals/Procyonidae/coatimundi  mammals/Procyonidae/coatimundi
 f  mammals/Procyonidae/raccoon     mammals/Procyonidae/raccoon