Show More
@@ -555,6 +555,9 b' class path_auditor(object):' | |||
|
555 | 555 | self.callback = callback |
|
556 | 556 | |
|
557 | 557 | def __call__(self, path): |
|
558 | '''Check the relative path. | |
|
559 | path may contain a pattern (e.g. foodir/**.txt)''' | |
|
560 | ||
|
558 | 561 | if path in self.audited: |
|
559 | 562 | return |
|
560 | 563 | # AIX ignores "/" at end of path, others raise EISDIR. |
@@ -574,7 +577,13 b' class path_auditor(object):' | |||
|
574 | 577 | base = os.path.join(*parts[:pos]) |
|
575 | 578 | raise Abort(_('path %r is inside nested repo %r') |
|
576 | 579 | % (path, base)) |
|
577 | def check(prefix): | |
|
580 | ||
|
581 | parts.pop() | |
|
582 | prefixes = [] | |
|
583 | while parts: | |
|
584 | prefix = os.sep.join(parts) | |
|
585 | if prefix in self.auditeddir: | |
|
586 | break | |
|
578 | 587 | curpath = os.path.join(self.root, prefix) |
|
579 | 588 | try: |
|
580 | 589 | st = os.lstat(curpath) |
@@ -592,13 +601,6 b' class path_auditor(object):' | |||
|
592 | 601 | if not self.callback or not self.callback(curpath): |
|
593 | 602 | raise Abort(_('path %r is inside nested repo %r') % |
|
594 | 603 | (path, prefix)) |
|
595 | parts.pop() | |
|
596 | prefixes = [] | |
|
597 | while parts: | |
|
598 | prefix = os.sep.join(parts) | |
|
599 | if prefix in self.auditeddir: | |
|
600 | break | |
|
601 | check(prefix) | |
|
602 | 604 | prefixes.append(prefix) |
|
603 | 605 | parts.pop() |
|
604 | 606 |
General Comments 0
You need to be logged in to leave comments.
Login now