##// END OF EJS Templates
manifest: backed out changeset b60a5fe98b73...
Pierre-Yves David -
r29915:548fa75c default
parent child Browse files
Show More
@@ -528,7 +528,7 b' class changectx(basectx):'
528 528
529 529 @propertycache
530 530 def _manifest(self):
531 return self._repo.manifestlog[self._changeset.manifest].read()
531 return self._repo.manifestlog[self._changeset.manifest]
532 532
533 533 @propertycache
534 534 def _manifestdelta(self):
@@ -962,13 +962,12 b' class manifestlog(object):'
962 962 self._mancache[node] = m
963 963 return m
964 964
965 class manifestctx(object):
965 class manifestctx(manifestdict):
966 966 """A class representing a single revision of a manifest, including its
967 967 contents, its parent revs, and its linkrev.
968 968 """
969 969 def __init__(self, revlog, node):
970 970 self._revlog = revlog
971 self._data = None
972 971
973 972 self._node = node
974 973
@@ -979,26 +978,21 b' class manifestctx(object):'
979 978 #rev = revlog.rev(node)
980 979 #self.linkrev = revlog.linkrev(rev)
981 980
981 # This should eventually be made lazy loaded, so consumers can access
982 # the node/p1/linkrev data without having to parse the whole manifest.
983 data = revlog.revision(node)
984 arraytext = array.array('c', data)
985 revlog._fulltextcache[node] = arraytext
986 super(manifestctx, self).__init__(data)
987
982 988 def node(self):
983 989 return self._node
984 990
985 def read(self):
986 if not self._data:
987 if self._node == revlog.nullid:
988 self._data = manifestdict()
989 else:
990 text = self._revlog.revision(self._node)
991 arraytext = array.array('c', text)
992 self._revlog._fulltextcache[self._node] = arraytext
993 self._data = manifestdict(text)
994 return self._data
995
996 class treemanifestctx(object):
991 class treemanifestctx(treemanifest):
997 992 def __init__(self, revlog, dir, node):
998 993 revlog = revlog.dirlog(dir)
999 994 self._revlog = revlog
1000 995 self._dir = dir
1001 self._data = None
1002 996
1003 997 self._node = node
1004 998
@@ -1009,26 +1003,19 b' class treemanifestctx(object):'
1009 1003 #rev = revlog.rev(node)
1010 1004 #self.linkrev = revlog.linkrev(rev)
1011 1005
1012 def read(self):
1013 if not self._data:
1014 if self._node == revlog.nullid:
1015 self._data = treemanifest()
1016 elif self._revlog._treeondisk:
1017 m = treemanifest(dir=self._dir)
1006 if revlog._treeondisk:
1007 super(treemanifestctx, self).__init__(dir=dir)
1018 1008 def gettext():
1019 return self._revlog.revision(self._node)
1009 return revlog.revision(node)
1020 1010 def readsubtree(dir, subm):
1021 return treemanifestctx(self._revlog, dir, subm).read()
1022 m.read(gettext, readsubtree)
1023 m.setnode(self._node)
1024 self._data = m
1011 return revlog.dirlog(dir).read(subm)
1012 self.read(gettext, readsubtree)
1013 self.setnode(node)
1025 1014 else:
1026 text = self._revlog.revision(self._node)
1015 text = revlog.revision(node)
1027 1016 arraytext = array.array('c', text)
1028 self._revlog.fulltextcache[self._node] = arraytext
1029 self._data = treemanifest(dir=self._dir, text=text)
1030
1031 return self._data
1017 revlog.fulltextcache[node] = arraytext
1018 super(treemanifestctx, self).__init__(dir=dir, text=text)
1032 1019
1033 1020 def node(self):
1034 1021 return self._node
General Comments 0
You need to be logged in to leave comments. Login now