comparison mercurial/manifest.py @ 24780:4ea521b3c554

manifest: duplicate call to addrevision() When we start writing submanifests to their own revlogs, we will not want to write a new revision for a directory if there were no changes to it. To prepare for this, duplicate the call to addrevision() and move them earlier where they can more easily be avoided.
author Martin von Zweigbergk <martinvonz@google.com>
date Sun, 12 Apr 2015 14:37:55 -0700
parents 03ee576784e6
children 055b3cbe6c57
comparison
equal deleted inserted replaced
24779:23727465ff72 24780:4ea521b3c554
834 work.sort() 834 work.sort()
835 835
836 arraytext, deltatext = m.fastdelta(self._mancache[p1][1], work) 836 arraytext, deltatext = m.fastdelta(self._mancache[p1][1], work)
837 cachedelta = self.rev(p1), deltatext 837 cachedelta = self.rev(p1), deltatext
838 text = util.buffer(arraytext) 838 text = util.buffer(arraytext)
839 n = self.addrevision(text, transaction, link, p1, p2, cachedelta)
839 else: 840 else:
840 # The first parent manifest isn't already loaded, so we'll 841 # The first parent manifest isn't already loaded, so we'll
841 # just encode a fulltext of the manifest and pass that 842 # just encode a fulltext of the manifest and pass that
842 # through to the revlog layer, and let it handle the delta 843 # through to the revlog layer, and let it handle the delta
843 # process. 844 # process.
844 text = m.text(self._usemanifestv2) 845 text = m.text(self._usemanifestv2)
845 arraytext = array.array('c', text) 846 arraytext = array.array('c', text)
846 cachedelta = None 847 n = self.addrevision(text, transaction, link, p1, p2)
847 848
848 n = self.addrevision(text, transaction, link, p1, p2, cachedelta)
849 self._mancache[n] = (m, arraytext) 849 self._mancache[n] = (m, arraytext)
850 850
851 return n 851 return n