changeset 7820:346fafc144fc

audit: be even pickier (issue1450)
author Matt Mackall <mpm@selenic.com>
date Wed, 04 Mar 2009 17:02:16 -0600
parents 14b703252f14
children 9fe7e6acf525
files mercurial/util.py tests/test-walk.out
diffstat 2 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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