##// END OF EJS Templates
manifest: adds manifestctx.readfast...
Durham Goode -
r29939:80be4436 default
parent child Browse files
Show More
@@ -824,7 +824,7 b' class basefilectx(object):'
824 """
824 """
825 repo = self._repo
825 repo = self._repo
826 cl = repo.unfiltered().changelog
826 cl = repo.unfiltered().changelog
827 ma = repo.manifest
827 mfl = repo.manifestlog
828 # fetch the linkrev
828 # fetch the linkrev
829 fr = filelog.rev(fnode)
829 fr = filelog.rev(fnode)
830 lkr = filelog.linkrev(fr)
830 lkr = filelog.linkrev(fr)
@@ -849,7 +849,7 b' class basefilectx(object):'
849 if path in ac[3]: # checking the 'files' field.
849 if path in ac[3]: # checking the 'files' field.
850 # The file has been touched, check if the content is
850 # The file has been touched, check if the content is
851 # similar to the one we search for.
851 # similar to the one we search for.
852 if fnode == ma.readfast(ac[0]).get(path):
852 if fnode == mfl[ac[0]].readfast().get(path):
853 return a
853 return a
854 # In theory, we should never get out of that loop without a result.
854 # In theory, we should never get out of that loop without a result.
855 # But if manifest uses a buggy file revision (not children of the
855 # But if manifest uses a buggy file revision (not children of the
@@ -993,6 +993,14 b' class manifestctx(object):'
993 self._data = manifestdict(text)
993 self._data = manifestdict(text)
994 return self._data
994 return self._data
995
995
996 def readfast(self):
997 rl = self._revlog
998 r = rl.rev(self._node)
999 deltaparent = rl.deltaparent(r)
1000 if deltaparent != revlog.nullrev and deltaparent in rl.parentrevs(r):
1001 return self.readdelta()
1002 return self.read()
1003
996 def readdelta(self):
1004 def readdelta(self):
997 revlog = self._revlog
1005 revlog = self._revlog
998 if revlog._usemanifestv2:
1006 if revlog._usemanifestv2:
@@ -1066,6 +1074,14 b' class treemanifestctx(object):'
1066 md.setflag(f, fl1)
1074 md.setflag(f, fl1)
1067 return md
1075 return md
1068
1076
1077 def readfast(self):
1078 rl = self._revlog
1079 r = rl.rev(self._node)
1080 deltaparent = rl.deltaparent(r)
1081 if deltaparent != revlog.nullrev and deltaparent in rl.parentrevs(r):
1082 return self.readdelta()
1083 return self.read()
1084
1069 class manifest(manifestrevlog):
1085 class manifest(manifestrevlog):
1070 def __init__(self, opener, dir='', dirlogcache=None):
1086 def __init__(self, opener, dir='', dirlogcache=None):
1071 '''The 'dir' and 'dirlogcache' arguments are for internal use by
1087 '''The 'dir' and 'dirlogcache' arguments are for internal use by
@@ -1149,20 +1165,6 b' class manifest(manifestrevlog):'
1149 d = mdiff.patchtext(self.revdiff(self.deltaparent(r), r))
1165 d = mdiff.patchtext(self.revdiff(self.deltaparent(r), r))
1150 return manifestdict(d)
1166 return manifestdict(d)
1151
1167
1152 def readfast(self, node):
1153 '''use the faster of readdelta or read
1154
1155 This will return a manifest which is either only the files
1156 added/modified relative to p1, or all files in the
1157 manifest. Which one is returned depends on the codepath used
1158 to retrieve the data.
1159 '''
1160 r = self.rev(node)
1161 deltaparent = self.deltaparent(r)
1162 if deltaparent != revlog.nullrev and deltaparent in self.parentrevs(r):
1163 return self.readdelta(node)
1164 return self.read(node)
1165
1166 def readshallowfast(self, node):
1168 def readshallowfast(self, node):
1167 '''like readfast(), but calls readshallowdelta() instead of readdelta()
1169 '''like readfast(), but calls readshallowdelta() instead of readdelta()
1168 '''
1170 '''
General Comments 0
You need to be logged in to leave comments. Login now