# HG changeset patch # User Matt Mackall # Date 1302205399 18000 # Node ID 93452579df9efc5a83d77670ef289c165802ade4 # Parent 184cf2fa1046848b18c2f12b2790ad8e81eb2044 audit: improve nested repo message diff -r 184cf2fa1046 -r 93452579df9e mercurial/util.py --- a/mercurial/util.py Thu Apr 07 17:16:17 2011 +0300 +++ b/mercurial/util.py Thu Apr 07 14:43:19 2011 -0500 @@ -530,7 +530,8 @@ 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)) + raise Abort(_('path %r is inside nested repo %r') + % (path, base)) def check(prefix): curpath = os.path.join(self.root, prefix) try: @@ -547,7 +548,7 @@ elif (stat.S_ISDIR(st.st_mode) and os.path.isdir(os.path.join(curpath, '.hg'))): if not self.callback or not self.callback(curpath): - raise Abort(_('path %r is inside repo %r') % + raise Abort(_('path %r is inside nested repo %r') % (path, prefix)) parts.pop() prefixes = [] diff -r 184cf2fa1046 -r 93452579df9e tests/test-audit-path.t --- a/tests/test-audit-path.t Thu Apr 07 17:16:17 2011 +0300 +++ b/tests/test-audit-path.t Thu Apr 07 14:43:19 2011 -0500 @@ -53,7 +53,7 @@ $ hg manifest -r1 foo/.hg/test $ hg update -Cr1 - abort: path 'foo/.hg/test' is inside repo 'foo' + abort: path 'foo/.hg/test' is inside nested repo 'foo' [255] attack back/test where back symlinks to .. diff -r 184cf2fa1046 -r 93452579df9e tests/test-nested-repo.t --- a/tests/test-nested-repo.t Thu Apr 07 17:16:17 2011 +0300 +++ b/tests/test-nested-repo.t Thu Apr 07 14:43:19 2011 -0500 @@ -11,16 +11,16 @@ Should fail: $ hg st b/x - abort: path 'b/x' is inside repo 'b' + abort: path 'b/x' is inside nested repo 'b' [255] $ hg add b/x - abort: path 'b/x' is inside repo 'b' + abort: path 'b/x' is inside nested repo 'b' [255] Should fail: $ hg add b b/x - abort: path 'b/x' is inside repo 'b' + abort: path 'b/x' is inside nested repo 'b' [255] $ hg st @@ -34,7 +34,7 @@ Should fail: $ hg mv a b - abort: path 'b/a' is inside repo 'b' + abort: path 'b/a' is inside nested repo 'b' [255] $ hg st diff -r 184cf2fa1046 -r 93452579df9e tests/test-walk.t --- a/tests/test-walk.t Thu Apr 07 17:16:17 2011 +0300 +++ b/tests/test-walk.t Thu Apr 07 14:43:19 2011 -0500 @@ -159,7 +159,7 @@ f mammals/Procyonidae/raccoon Procyonidae/raccoon f mammals/skunk skunk $ hg debugwalk .hg - abort: path 'mammals/.hg' is inside repo 'mammals' + abort: path 'mammals/.hg' is inside nested repo 'mammals' [255] $ hg debugwalk ../.hg abort: path contains illegal component: .hg @@ -203,7 +203,7 @@ abort: path contains illegal component: .hg/data [255] $ hg debugwalk beans/.hg - abort: path 'beans/.hg' is inside repo 'beans' + abort: path 'beans/.hg' is inside nested repo 'beans' [255] Test absolute paths: