Show More
@@ -692,7 +692,8 b' class path_auditor(object):' | |||
|
692 | 692 | - inside a nested repository''' |
|
693 | 693 | |
|
694 | 694 | def __init__(self, root): |
|
695 |
self.audited = |
|
|
695 | self.audited = set() | |
|
696 | self.auditeddir = set() | |
|
696 | 697 | self.root = root |
|
697 | 698 | |
|
698 | 699 | def __call__(self, path): |
@@ -720,10 +721,19 b' class path_auditor(object):' | |||
|
720 | 721 | os.path.isdir(os.path.join(curpath, '.hg'))): |
|
721 | 722 | raise Abort(_('path %r is inside repo %r') % |
|
722 | 723 | (path, prefix)) |
|
723 | self.audited[prefix] = True | |
|
724 | ||
|
725 | prefixes = [] | |
|
724 | 726 | for c in strutil.rfindall(normpath, os.sep): |
|
725 |
|
|
|
726 | self.audited[path] = True | |
|
727 | prefix = normpath[:c] | |
|
728 | if prefix in self.auditeddir: | |
|
729 | break | |
|
730 | check(prefix) | |
|
731 | prefixes.append(prefix) | |
|
732 | ||
|
733 | self.audited.add(path) | |
|
734 | # only add prefixes to the cache after checking everything: we don't | |
|
735 | # want to add "foo/bar/baz" before checking if there's a "foo/.hg" | |
|
736 | self.auditeddir.update(prefixes) | |
|
727 | 737 | |
|
728 | 738 | def _makelock_file(info, pathname): |
|
729 | 739 | ld = os.open(pathname, os.O_CREAT | os.O_WRONLY | os.O_EXCL) |
General Comments 0
You need to be logged in to leave comments.
Login now