Show More
@@ -528,7 +528,7 b' class changectx(basectx):' | |||||
528 |
|
528 | |||
529 | @propertycache |
|
529 | @propertycache | |
530 | def _manifest(self): |
|
530 | def _manifest(self): | |
531 |
return self._repo.manifestlog[self._changeset.manifest] |
|
531 | return self._repo.manifestlog[self._changeset.manifest] | |
532 |
|
532 | |||
533 | @propertycache |
|
533 | @propertycache | |
534 | def _manifestdelta(self): |
|
534 | def _manifestdelta(self): |
@@ -962,13 +962,12 b' class manifestlog(object):' | |||||
962 | self._mancache[node] = m |
|
962 | self._mancache[node] = m | |
963 | return m |
|
963 | return m | |
964 |
|
964 | |||
965 |
class manifestctx( |
|
965 | class manifestctx(manifestdict): | |
966 | """A class representing a single revision of a manifest, including its |
|
966 | """A class representing a single revision of a manifest, including its | |
967 | contents, its parent revs, and its linkrev. |
|
967 | contents, its parent revs, and its linkrev. | |
968 | """ |
|
968 | """ | |
969 | def __init__(self, revlog, node): |
|
969 | def __init__(self, revlog, node): | |
970 | self._revlog = revlog |
|
970 | self._revlog = revlog | |
971 | self._data = None |
|
|||
972 |
|
971 | |||
973 | self._node = node |
|
972 | self._node = node | |
974 |
|
973 | |||
@@ -979,26 +978,21 b' class manifestctx(object):' | |||||
979 | #rev = revlog.rev(node) |
|
978 | #rev = revlog.rev(node) | |
980 | #self.linkrev = revlog.linkrev(rev) |
|
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 | def node(self): |
|
988 | def node(self): | |
983 | return self._node |
|
989 | return self._node | |
984 |
|
990 | |||
985 | def read(self): |
|
991 | class treemanifestctx(treemanifest): | |
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): |
|
|||
997 | def __init__(self, revlog, dir, node): |
|
992 | def __init__(self, revlog, dir, node): | |
998 | revlog = revlog.dirlog(dir) |
|
993 | revlog = revlog.dirlog(dir) | |
999 | self._revlog = revlog |
|
994 | self._revlog = revlog | |
1000 | self._dir = dir |
|
995 | self._dir = dir | |
1001 | self._data = None |
|
|||
1002 |
|
996 | |||
1003 | self._node = node |
|
997 | self._node = node | |
1004 |
|
998 | |||
@@ -1009,26 +1003,19 b' class treemanifestctx(object):' | |||||
1009 | #rev = revlog.rev(node) |
|
1003 | #rev = revlog.rev(node) | |
1010 | #self.linkrev = revlog.linkrev(rev) |
|
1004 | #self.linkrev = revlog.linkrev(rev) | |
1011 |
|
1005 | |||
1012 | def read(self): |
|
1006 | if revlog._treeondisk: | |
1013 | if not self._data: |
|
1007 | super(treemanifestctx, self).__init__(dir=dir) | |
1014 | if self._node == revlog.nullid: |
|
1008 | def gettext(): | |
1015 | self._data = treemanifest() |
|
1009 | return revlog.revision(node) | |
1016 |
e |
|
1010 | def readsubtree(dir, subm): | |
1017 | m = treemanifest(dir=self._dir) |
|
1011 | return revlog.dirlog(dir).read(subm) | |
1018 | def gettext(): |
|
1012 | self.read(gettext, readsubtree) | |
1019 | return self._revlog.revision(self._node) |
|
1013 | self.setnode(node) | |
1020 | def readsubtree(dir, subm): |
|
1014 | else: | |
1021 | return treemanifestctx(self._revlog, dir, subm).read() |
|
1015 | text = revlog.revision(node) | |
1022 | m.read(gettext, readsubtree) |
|
1016 | arraytext = array.array('c', text) | |
1023 | m.setnode(self._node) |
|
1017 | revlog.fulltextcache[node] = arraytext | |
1024 | self._data = m |
|
1018 | super(treemanifestctx, self).__init__(dir=dir, text=text) | |
1025 | else: |
|
|||
1026 | text = self._revlog.revision(self._node) |
|
|||
1027 | 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 |
|
|||
1032 |
|
1019 | |||
1033 | def node(self): |
|
1020 | def node(self): | |
1034 | return self._node |
|
1021 | return self._node |
General Comments 0
You need to be logged in to leave comments.
Login now