Show More
@@ -16,12 +16,10 b' import cStringIO, osutil, sys' | |||
|
16 | 16 | _format = ">cllll" |
|
17 | 17 | |
|
18 | 18 | def _finddirs(path): |
|
19 |
pos = |
|
|
20 | while 1: | |
|
19 | pos = path.rfind('/') | |
|
20 | while pos != -1: | |
|
21 | yield path[:pos] | |
|
21 | 22 | pos = path.rfind('/', 0, pos) |
|
22 | if pos == -1: | |
|
23 | break | |
|
24 | yield path[:pos] | |
|
25 | 23 | |
|
26 | 24 | class dirstate(object): |
|
27 | 25 | |
@@ -65,10 +63,16 b' class dirstate(object):' | |||
|
65 | 63 | return self._pl |
|
66 | 64 | elif name == '_dirs': |
|
67 | 65 | dirs = {} |
|
68 | for f,s in self._map.items(): | |
|
66 | for f,s in self._map.iteritems(): | |
|
69 | 67 | if s[0] != 'r': |
|
70 |
|
|
|
71 | dirs[base] = dirs.get(base, 0) + 1 | |
|
68 | pos = f.rfind('/') | |
|
69 | while pos != -1: | |
|
70 | f = f[:pos] | |
|
71 | if f in dirs: | |
|
72 | dirs[f] += 1 | |
|
73 | break | |
|
74 | dirs[f] = 1 | |
|
75 | pos = f.rfind('/') | |
|
72 | 76 | self._dirs = dirs |
|
73 | 77 | return self._dirs |
|
74 | 78 | elif name == '_ignore': |
@@ -242,7 +246,7 b' class dirstate(object):' | |||
|
242 | 246 | for base in _finddirs(f): |
|
243 | 247 | if dirs[base] == 1: |
|
244 | 248 | del dirs[base] |
|
245 |
|
|
|
249 | return | |
|
246 | 250 |
|
|
247 | 251 | |
|
248 | 252 | def _addpath(self, f, check=False): |
General Comments 0
You need to be logged in to leave comments.
Login now