##// END OF EJS Templates
audit: improve nested repo message
Matt Mackall -
r13910:93452579 default
parent child Browse files
Show More
@@ -530,7 +530,8 b' class path_auditor(object):'
530 if p in lparts[1:]:
530 if p in lparts[1:]:
531 pos = lparts.index(p)
531 pos = lparts.index(p)
532 base = os.path.join(*parts[:pos])
532 base = os.path.join(*parts[:pos])
533 raise Abort(_('path %r is inside repo %r') % (path, base))
533 raise Abort(_('path %r is inside nested repo %r')
534 % (path, base))
534 def check(prefix):
535 def check(prefix):
535 curpath = os.path.join(self.root, prefix)
536 curpath = os.path.join(self.root, prefix)
536 try:
537 try:
@@ -547,7 +548,7 b' class path_auditor(object):'
547 elif (stat.S_ISDIR(st.st_mode) and
548 elif (stat.S_ISDIR(st.st_mode) and
548 os.path.isdir(os.path.join(curpath, '.hg'))):
549 os.path.isdir(os.path.join(curpath, '.hg'))):
549 if not self.callback or not self.callback(curpath):
550 if not self.callback or not self.callback(curpath):
550 raise Abort(_('path %r is inside repo %r') %
551 raise Abort(_('path %r is inside nested repo %r') %
551 (path, prefix))
552 (path, prefix))
552 parts.pop()
553 parts.pop()
553 prefixes = []
554 prefixes = []
@@ -53,7 +53,7 b' attack foo/.hg/test'
53 $ hg manifest -r1
53 $ hg manifest -r1
54 foo/.hg/test
54 foo/.hg/test
55 $ hg update -Cr1
55 $ hg update -Cr1
56 abort: path 'foo/.hg/test' is inside repo 'foo'
56 abort: path 'foo/.hg/test' is inside nested repo 'foo'
57 [255]
57 [255]
58
58
59 attack back/test where back symlinks to ..
59 attack back/test where back symlinks to ..
@@ -11,16 +11,16 b' Should print nothing:'
11 Should fail:
11 Should fail:
12
12
13 $ hg st b/x
13 $ hg st b/x
14 abort: path 'b/x' is inside repo 'b'
14 abort: path 'b/x' is inside nested repo 'b'
15 [255]
15 [255]
16 $ hg add b/x
16 $ hg add b/x
17 abort: path 'b/x' is inside repo 'b'
17 abort: path 'b/x' is inside nested repo 'b'
18 [255]
18 [255]
19
19
20 Should fail:
20 Should fail:
21
21
22 $ hg add b b/x
22 $ hg add b b/x
23 abort: path 'b/x' is inside repo 'b'
23 abort: path 'b/x' is inside nested repo 'b'
24 [255]
24 [255]
25 $ hg st
25 $ hg st
26
26
@@ -34,7 +34,7 b' Should arguably print nothing:'
34 Should fail:
34 Should fail:
35
35
36 $ hg mv a b
36 $ hg mv a b
37 abort: path 'b/a' is inside repo 'b'
37 abort: path 'b/a' is inside nested repo 'b'
38 [255]
38 [255]
39 $ hg st
39 $ hg st
40
40
@@ -159,7 +159,7 b''
159 f mammals/Procyonidae/raccoon Procyonidae/raccoon
159 f mammals/Procyonidae/raccoon Procyonidae/raccoon
160 f mammals/skunk skunk
160 f mammals/skunk skunk
161 $ hg debugwalk .hg
161 $ hg debugwalk .hg
162 abort: path 'mammals/.hg' is inside repo 'mammals'
162 abort: path 'mammals/.hg' is inside nested repo 'mammals'
163 [255]
163 [255]
164 $ hg debugwalk ../.hg
164 $ hg debugwalk ../.hg
165 abort: path contains illegal component: .hg
165 abort: path contains illegal component: .hg
@@ -203,7 +203,7 b''
203 abort: path contains illegal component: .hg/data
203 abort: path contains illegal component: .hg/data
204 [255]
204 [255]
205 $ hg debugwalk beans/.hg
205 $ hg debugwalk beans/.hg
206 abort: path 'beans/.hg' is inside repo 'beans'
206 abort: path 'beans/.hg' is inside nested repo 'beans'
207 [255]
207 [255]
208
208
209 Test absolute paths:
209 Test absolute paths:
General Comments 0
You need to be logged in to leave comments. Login now