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