Show More
@@ -701,15 +701,22 b' class treemanifest(object):' | |||
|
701 | 701 | return self._dir + path |
|
702 | 702 | |
|
703 | 703 | def _loadalllazy(self): |
|
704 | for k, (path, node, readsubtree) in self._lazydirs.iteritems(): | |
|
705 | self._dirs[k] = readsubtree(path, node) | |
|
704 | selfdirs = self._dirs | |
|
705 | for d, (path, node, readsubtree, docopy) in self._lazydirs.iteritems(): | |
|
706 | if docopy: | |
|
707 | selfdirs[d] = readsubtree(path, node).copy() | |
|
708 | else: | |
|
709 | selfdirs[d] = readsubtree(path, node) | |
|
706 | 710 | self._lazydirs = {} |
|
707 | 711 | |
|
708 | 712 | def _loadlazy(self, d): |
|
709 | 713 | v = self._lazydirs.get(d) |
|
710 | 714 | if v: |
|
711 | path, node, readsubtree = v | |
|
712 | self._dirs[d] = readsubtree(path, node) | |
|
715 | path, node, readsubtree, docopy = v | |
|
716 | if docopy: | |
|
717 | self._dirs[d] = readsubtree(path, node).copy() | |
|
718 | else: | |
|
719 | self._dirs[d] = readsubtree(path, node) | |
|
713 | 720 | del self._lazydirs[d] |
|
714 | 721 | |
|
715 | 722 | def _loadchildrensetlazy(self, visit): |
@@ -1170,7 +1177,9 b' class treemanifest(object):' | |||
|
1170 | 1177 | for f, n, fl in _parse(text): |
|
1171 | 1178 | if fl == 't': |
|
1172 | 1179 | f = f + '/' |
|
1173 | selflazy[f] = (subpath(f), n, readsubtree) | |
|
1180 | # False below means "doesn't need to be copied" and can use the | |
|
1181 | # cached value from readsubtree directly. | |
|
1182 | selflazy[f] = (subpath(f), n, readsubtree, False) | |
|
1174 | 1183 | elif '/' in f: |
|
1175 | 1184 | # This is a flat manifest, so use __setitem__ and setflag rather |
|
1176 | 1185 | # than assigning directly to _files and _flags, so we can |
@@ -1197,8 +1206,7 b' class treemanifest(object):' | |||
|
1197 | 1206 | """ |
|
1198 | 1207 | self._load() |
|
1199 | 1208 | flags = self.flags |
|
1200 |
lazydirs = [(d[:-1], |
|
|
1201 | d, (path, node, readsubtree) in self._lazydirs.iteritems()] | |
|
1209 | lazydirs = [(d[:-1], v[1], 't') for d, v in self._lazydirs.iteritems()] | |
|
1202 | 1210 | dirs = [(d[:-1], self._dirs[d]._node, 't') for d in self._dirs] |
|
1203 | 1211 | files = [(f, self._files[f], flags(f)) for f in self._files] |
|
1204 | 1212 | return _text(sorted(dirs + files + lazydirs)) |
General Comments 0
You need to be logged in to leave comments.
Login now