audit: be even pickier (issue1450)
authorMatt Mackall <mpm@selenic.com>
Wed, 04 Mar 2009 17:02:16 -0600
changeset 7820 346fafc144fc
parent 7819 14b703252f14
child 7821 9fe7e6acf525
audit: be even pickier (issue1450)
mercurial/util.py
tests/test-walk.out
--- a/mercurial/util.py	Thu Feb 12 09:36:15 2009 -0700
+++ b/mercurial/util.py	Wed Mar 04 17:02:16 2009 -0600
@@ -822,7 +822,7 @@
         if '.hg' in path.lower():
             lparts = [p.lower() for p in parts]
             for p in '.hg', '.hg.':
-                if p in lparts[1:-1]:
+                if p in lparts[1:]:
                     pos = lparts.index(p)
                     base = os.path.join(*parts[:pos])
                     raise Abort(_('path %r is inside repo %r') % (path, base))
--- a/tests/test-walk.out	Thu Feb 12 09:36:15 2009 -0700
+++ b/tests/test-walk.out	Wed Mar 04 17:02:16 2009 -0600
@@ -159,7 +159,7 @@
 f  mammals/skunk                   skunk
 
 hg debugwalk .hg
-.hg: No such file or directory
+abort: path 'mammals/.hg' is inside repo 'mammals'
 
 hg debugwalk ../.hg
 abort: path contains illegal component: .hg
@@ -208,7 +208,7 @@
 abort: path contains illegal component: .hg/data
 
 hg debugwalk beans/.hg
-beans/.hg: No such file or directory
+abort: path 'beans/.hg' is inside repo 'beans'
 
 hg debugwalk glob:*
 f  fennel      fennel