util._matcher: use "." as the root of empty {rel,}path patterns
authorAlexis S. L. Carvalho <alexis@cecm.usp.br>
Fri, 16 Mar 2007 22:48:20 -0300
changeset 4233 03a665f9f913
parent 4194 ec932167c3a7
child 4234 fe0c0a317c09
util._matcher: use "." as the root of empty {rel,}path patterns Should fix issue332. Really.
mercurial/util.py
tests/test-revert
tests/test-revert.out
--- a/mercurial/util.py
+++ b/mercurial/util.py
@@ -492,7 +492,7 @@ def _matcher(canonroot, cwd, names, inc,
                 roots.append(root)
             elif kind in ('relpath', 'path'):
                 files.append((kind, name))
-                roots.append(name)
+                roots.append(name or '.')
             elif kind == 'relglob':
                 roots.append('.')
         return roots, pats + files, anypats
--- a/tests/test-revert
+++ b/tests/test-revert
@@ -89,4 +89,6 @@ echo %% issue332
 hg ci -A -m b -d '1000001 0'
 echo foobar > b/b
 hg revert b
+echo foobar > b/b
+hg revert .
 true
--- a/tests/test-revert.out
+++ b/tests/test-revert.out
@@ -61,3 +61,4 @@ reverting a
 %% issue332
 adding b/b
 reverting b/b
+reverting b/b