##// END OF EJS Templates
revlog: avoid caching raw text too early in _revisiondata...
marmoute -
r43059:90f5dfc9 default
parent child Browse files
Show More
@@ -1633,11 +1633,14 b' class revlog(object):'
1633 rawtext = None
1633 rawtext = None
1634 # An intermediate text to apply deltas to
1634 # An intermediate text to apply deltas to
1635 basetext = None
1635 basetext = None
1636 # Do we need to update the rawtext cache once it is validated ?
1637 needcaching = True
1636
1638
1637 # Check if we have the entry in cache
1639 # Check if we have the entry in cache
1638 # The cache entry looks like (node, rev, rawtext)
1640 # The cache entry looks like (node, rev, rawtext)
1639 if self._revisioncache:
1641 if self._revisioncache:
1640 if self._revisioncache[0] == node:
1642 if self._revisioncache[0] == node:
1643 needcaching = False
1641 # _cache only stores rawtext
1644 # _cache only stores rawtext
1642 # rawtext is reusable. but we might need to run flag processors
1645 # rawtext is reusable. but we might need to run flag processors
1643 rawtext = self._revisioncache[2]
1646 rawtext = self._revisioncache[2]
@@ -1680,7 +1683,6 b' class revlog(object):'
1680
1683
1681 rawtext = mdiff.patches(basetext, bins)
1684 rawtext = mdiff.patches(basetext, bins)
1682 del basetext # let us have a chance to free memory early
1685 del basetext # let us have a chance to free memory early
1683 self._revisioncache = (node, rev, rawtext)
1684
1686
1685 if flags is None:
1687 if flags is None:
1686 if rev is None:
1688 if rev is None:
@@ -1691,6 +1693,9 b' class revlog(object):'
1691 if validatehash:
1693 if validatehash:
1692 self.checkhash(text, node, rev=rev)
1694 self.checkhash(text, node, rev=rev)
1693
1695
1696 if needcaching:
1697 self._revisioncache = (node, rev, rawtext)
1698
1694 return text
1699 return text
1695
1700
1696 def rawdata(self, nodeorrev, _df=None):
1701 def rawdata(self, nodeorrev, _df=None):
General Comments 0
You need to be logged in to leave comments. Login now