Show More
@@ -205,7 +205,7 b' class bundlemanifest(bundlerevlog, manif' | |||||
205 | node = self.node(node) |
|
205 | node = self.node(node) | |
206 |
|
206 | |||
207 | if node in self._mancache: |
|
207 | if node in self._mancache: | |
208 |
result = self._mancache[node] |
|
208 | result = self._mancache[node].text() | |
209 | else: |
|
209 | else: | |
210 | result = manifest.manifest.revision(self, nodeorrev) |
|
210 | result = manifest.manifest.revision(self, nodeorrev) | |
211 | return result |
|
211 | return result |
@@ -908,6 +908,7 b' class manifest(revlog.revlog):' | |||||
908 | usetreemanifest = opts.get('treemanifest', usetreemanifest) |
|
908 | usetreemanifest = opts.get('treemanifest', usetreemanifest) | |
909 | usemanifestv2 = opts.get('manifestv2', usemanifestv2) |
|
909 | usemanifestv2 = opts.get('manifestv2', usemanifestv2) | |
910 | self._mancache = util.lrucachedict(cachesize) |
|
910 | self._mancache = util.lrucachedict(cachesize) | |
|
911 | self._fulltextcache = util.lrucachedict(cachesize) | |||
911 | self._treeinmem = usetreemanifest |
|
912 | self._treeinmem = usetreemanifest | |
912 | self._treeondisk = usetreemanifest |
|
913 | self._treeondisk = usetreemanifest | |
913 | self._usemanifestv2 = usemanifestv2 |
|
914 | self._usemanifestv2 = usemanifestv2 | |
@@ -1000,7 +1001,7 b' class manifest(revlog.revlog):' | |||||
1000 | if node == revlog.nullid: |
|
1001 | if node == revlog.nullid: | |
1001 | return self._newmanifest() # don't upset local cache |
|
1002 | return self._newmanifest() # don't upset local cache | |
1002 | if node in self._mancache: |
|
1003 | if node in self._mancache: | |
1003 |
return self._mancache[node] |
|
1004 | return self._mancache[node] | |
1004 | if self._treeondisk: |
|
1005 | if self._treeondisk: | |
1005 | def gettext(): |
|
1006 | def gettext(): | |
1006 | return self.revision(node) |
|
1007 | return self.revision(node) | |
@@ -1014,7 +1015,8 b' class manifest(revlog.revlog):' | |||||
1014 | text = self.revision(node) |
|
1015 | text = self.revision(node) | |
1015 | m = self._newmanifest(text) |
|
1016 | m = self._newmanifest(text) | |
1016 | arraytext = array.array('c', text) |
|
1017 | arraytext = array.array('c', text) | |
1017 |
self._mancache[node] = |
|
1018 | self._mancache[node] = m | |
|
1019 | self._fulltextcache[node] = arraytext | |||
1018 | return m |
|
1020 | return m | |
1019 |
|
1021 | |||
1020 | def readshallow(self, node): |
|
1022 | def readshallow(self, node): | |
@@ -1034,7 +1036,7 b' class manifest(revlog.revlog):' | |||||
1034 | return None, None |
|
1036 | return None, None | |
1035 |
|
1037 | |||
1036 | def add(self, m, transaction, link, p1, p2, added, removed): |
|
1038 | def add(self, m, transaction, link, p1, p2, added, removed): | |
1037 |
if (p1 in self._ |
|
1039 | if (p1 in self._fulltextcache and not self._treeinmem | |
1038 | and not self._usemanifestv2): |
|
1040 | and not self._usemanifestv2): | |
1039 | # If our first parent is in the manifest cache, we can |
|
1041 | # If our first parent is in the manifest cache, we can | |
1040 | # compute a delta here using properties we know about the |
|
1042 | # compute a delta here using properties we know about the | |
@@ -1046,7 +1048,7 b' class manifest(revlog.revlog):' | |||||
1046 | work = heapq.merge([(x, False) for x in added], |
|
1048 | work = heapq.merge([(x, False) for x in added], | |
1047 | [(x, True) for x in removed]) |
|
1049 | [(x, True) for x in removed]) | |
1048 |
|
1050 | |||
1049 |
arraytext, deltatext = m.fastdelta(self._ |
|
1051 | arraytext, deltatext = m.fastdelta(self._fulltextcache[p1], work) | |
1050 | cachedelta = self.rev(p1), deltatext |
|
1052 | cachedelta = self.rev(p1), deltatext | |
1051 | text = util.buffer(arraytext) |
|
1053 | text = util.buffer(arraytext) | |
1052 | n = self.addrevision(text, transaction, link, p1, p2, cachedelta) |
|
1054 | n = self.addrevision(text, transaction, link, p1, p2, cachedelta) | |
@@ -1065,7 +1067,8 b' class manifest(revlog.revlog):' | |||||
1065 | n = self.addrevision(text, transaction, link, p1, p2) |
|
1067 | n = self.addrevision(text, transaction, link, p1, p2) | |
1066 | arraytext = array.array('c', text) |
|
1068 | arraytext = array.array('c', text) | |
1067 |
|
1069 | |||
1068 |
self._mancache[n] = |
|
1070 | self._mancache[n] = m | |
|
1071 | self._fulltextcache[n] = arraytext | |||
1069 |
|
1072 | |||
1070 | return n |
|
1073 | return n | |
1071 |
|
1074 | |||
@@ -1092,5 +1095,6 b' class manifest(revlog.revlog):' | |||||
1092 |
|
1095 | |||
1093 | def clearcaches(self): |
|
1096 | def clearcaches(self): | |
1094 | super(manifest, self).clearcaches() |
|
1097 | super(manifest, self).clearcaches() | |
|
1098 | self._fulltextcache.clear() | |||
1095 | self._mancache.clear() |
|
1099 | self._mancache.clear() | |
1096 | self._dirlogcache = {'': self} |
|
1100 | self._dirlogcache = {'': self} |
General Comments 0
You need to be logged in to leave comments.
Login now