##// END OF EJS Templates
manifest: move manifest parsing to module-level...
Augie Fackler -
r22786:079a0ed5 default
parent child Browse files
Show More
@@ -70,6 +70,10 b' def _addlistdelta(addlist, x):'
70 + content for start, end, content in x)
70 + content for start, end, content in x)
71 return deltatext, newaddlist
71 return deltatext, newaddlist
72
72
73 def _parse(lines):
74 mfdict = manifestdict()
75 parsers.parse_manifest(mfdict, mfdict._flags, lines)
76 return mfdict
73
77
74 class manifest(revlog.revlog):
78 class manifest(revlog.revlog):
75 def __init__(self, opener):
79 def __init__(self, opener):
@@ -78,14 +82,9 b' class manifest(revlog.revlog):'
78 self._mancache = util.lrucachedict(4)
82 self._mancache = util.lrucachedict(4)
79 revlog.revlog.__init__(self, opener, "00manifest.i")
83 revlog.revlog.__init__(self, opener, "00manifest.i")
80
84
81 def parse(self, lines):
82 mfdict = manifestdict()
83 parsers.parse_manifest(mfdict, mfdict._flags, lines)
84 return mfdict
85
86 def readdelta(self, node):
85 def readdelta(self, node):
87 r = self.rev(node)
86 r = self.rev(node)
88 return self.parse(mdiff.patchtext(self.revdiff(self.deltaparent(r), r)))
87 return _parse(mdiff.patchtext(self.revdiff(self.deltaparent(r), r)))
89
88
90 def readfast(self, node):
89 def readfast(self, node):
91 '''use the faster of readdelta or read'''
90 '''use the faster of readdelta or read'''
@@ -102,7 +101,7 b' class manifest(revlog.revlog):'
102 return self._mancache[node][0]
101 return self._mancache[node][0]
103 text = self.revision(node)
102 text = self.revision(node)
104 arraytext = array.array('c', text)
103 arraytext = array.array('c', text)
105 mapping = self.parse(text)
104 mapping = _parse(text)
106 self._mancache[node] = (mapping, arraytext)
105 self._mancache[node] = (mapping, arraytext)
107 return mapping
106 return mapping
108
107
General Comments 0
You need to be logged in to leave comments. Login now