changeset 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 23727465ff72
children 055b3cbe6c57
files mercurial/manifest.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/manifest.py	Thu Apr 16 14:26:50 2015 -0700
+++ b/mercurial/manifest.py	Sun Apr 12 14:37:55 2015 -0700
@@ -836,6 +836,7 @@
             arraytext, deltatext = m.fastdelta(self._mancache[p1][1], work)
             cachedelta = self.rev(p1), deltatext
             text = util.buffer(arraytext)
+            n = self.addrevision(text, transaction, link, p1, p2, cachedelta)
         else:
             # The first parent manifest isn't already loaded, so we'll
             # just encode a fulltext of the manifest and pass that
@@ -843,9 +844,8 @@
             # process.
             text = m.text(self._usemanifestv2)
             arraytext = array.array('c', text)
-            cachedelta = None
+            n = self.addrevision(text, transaction, link, p1, p2)
 
-        n = self.addrevision(text, transaction, link, p1, p2, cachedelta)
         self._mancache[n] = (m, arraytext)
 
         return n