Patchwork [2,of,3,V3] localrepo: make it possible to reuse manifest when commiting context

login
register
mail settings
Submitter Mateusz Kwapich
Date Nov. 21, 2016, 4:13 p.m.
Message ID <4a0824bead3ba5980bd8.1479744811@devvm314.lla2.facebook.com>
Download mbox | patch
Permalink /patch/17667/
State Accepted
Headers show

Comments

Mateusz Kwapich - Nov. 21, 2016, 4:13 p.m.
# HG changeset patch
# User Mateusz Kwapich <mitrandir@fb.com>
# Date 1479409155 28800
#      Thu Nov 17 10:59:15 2016 -0800
# Node ID 4a0824bead3ba5980bd8528937fba5f7bb31ba9f
# Parent  7dfd4c184ee087f2c05e1bdae8a10ccefbff7a92
localrepo: make it possible to reuse manifest when commiting context

This makes the commit function understand the context that's reusing manifest.

Patch

diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -1695,7 +1695,11 @@  class localrepository(object):
             tr = self.transaction("commit")
             trp = weakref.proxy(tr)
 
-            if ctx.files():
+            if ctx.manifestnode():
+                # reuse an existing manifest revision
+                mn = ctx.manifestnode()
+                files = ctx.files()
+            elif ctx.files():
                 m1ctx = p1.manifestctx()
                 m2ctx = p2.manifestctx()
                 mctx = m1ctx.copy()