# HG changeset patch # User Alexis S. L. Carvalho # Date 2007-03-11 02:00:49 # Node ID b1716a1f79c4c2340a343ce61e5e7adcd85d6153 # Parent ce3ecf99a18ba32c6d4dd963707d357078deb91a util._matcher: fix handling of path: patterns diff --git a/mercurial/util.py b/mercurial/util.py --- 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': diff --git a/tests/test-walk b/tests/test-walk --- 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/*' diff --git a/tests/test-walk.out b/tests/test-walk.out --- 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