Show More
@@ -25,21 +25,15 b' class rootcache(filecache):' | |||||
25 | def join(self, obj, fname): |
|
25 | def join(self, obj, fname): | |
26 | return obj._join(fname) |
|
26 | return obj._join(fname) | |
27 |
|
27 | |||
28 | def _finddirs(path): |
|
|||
29 | pos = path.rfind('/') |
|
|||
30 | while pos != -1: |
|
|||
31 | yield path[:pos] |
|
|||
32 | pos = path.rfind('/', 0, pos) |
|
|||
33 |
|
||||
34 | def _incdirs(dirs, path): |
|
28 | def _incdirs(dirs, path): | |
35 |
for base in |
|
29 | for base in scmutil.finddirs(path): | |
36 | if base in dirs: |
|
30 | if base in dirs: | |
37 | dirs[base] += 1 |
|
31 | dirs[base] += 1 | |
38 | return |
|
32 | return | |
39 | dirs[base] = 1 |
|
33 | dirs[base] = 1 | |
40 |
|
34 | |||
41 | def _decdirs(dirs, path): |
|
35 | def _decdirs(dirs, path): | |
42 |
for base in |
|
36 | for base in scmutil.finddirs(path): | |
43 | if dirs[base] > 1: |
|
37 | if dirs[base] > 1: | |
44 | dirs[base] -= 1 |
|
38 | dirs[base] -= 1 | |
45 | return |
|
39 | return | |
@@ -346,7 +340,7 b' class dirstate(object):' | |||||
346 | if f in self._dirs: |
|
340 | if f in self._dirs: | |
347 | raise util.Abort(_('directory %r already in dirstate') % f) |
|
341 | raise util.Abort(_('directory %r already in dirstate') % f) | |
348 | # shadows |
|
342 | # shadows | |
349 |
for d in |
|
343 | for d in scmutil.finddirs(f): | |
350 | if d in self._dirs: |
|
344 | if d in self._dirs: | |
351 | break |
|
345 | break | |
352 | if d in self._map and self[d] != 'r': |
|
346 | if d in self._map and self[d] != 'r': | |
@@ -540,7 +534,7 b' class dirstate(object):' | |||||
540 | return False |
|
534 | return False | |
541 | if self._ignore(f): |
|
535 | if self._ignore(f): | |
542 | return True |
|
536 | return True | |
543 |
for p in |
|
537 | for p in scmutil.finddirs(f): | |
544 | if self._ignore(p): |
|
538 | if self._ignore(p): | |
545 | return True |
|
539 | return True | |
546 | return False |
|
540 | return False |
@@ -890,3 +890,9 b' class filecache(object):' | |||||
890 | del obj.__dict__[self.name] |
|
890 | del obj.__dict__[self.name] | |
891 | except KeyError: |
|
891 | except KeyError: | |
892 | raise AttributeError(self.name) |
|
892 | raise AttributeError(self.name) | |
|
893 | ||||
|
894 | def finddirs(path): | |||
|
895 | pos = path.rfind('/') | |||
|
896 | while pos != -1: | |||
|
897 | yield path[:pos] | |||
|
898 | pos = path.rfind('/', 0, pos) |
General Comments 0
You need to be logged in to leave comments.
Login now