diff mercurial/merge.py @ 38425:1322ae04d3d7 stable

merge: do not fill manifest of committed revision with pseudo node (issue5526) Since a75d24539aba "convert: fix convert dropping p2 contents during filemap merge", wctx is not always a committablectx because the convert extension passes in repo[n] as wctx. If wctx is a committed changeset, its manifest dict shouldn't be mutated reflecting to the working directory.
author Yuya Nishihara <yuya@tcha.org>
date Tue, 19 Jun 2018 22:45:52 +0900
parents 7269b87f817c
children 00368bc0a614
line wrap: on
line diff
--- a/mercurial/merge.py	Fri Jun 15 22:16:58 2018 +0900
+++ b/mercurial/merge.py	Tue Jun 19 22:45:52 2018 +0900
@@ -1106,8 +1106,10 @@
     copied = set(copy.values())
     copied.update(movewithdir.values())
 
-    if '.hgsubstate' in m1:
-        # check whether sub state is modified
+    if '.hgsubstate' in m1 and wctx.rev() is None:
+        # Check whether sub state is modified, and overwrite the manifest
+        # to flag the change. If wctx is a committed revision, we shouldn't
+        # care for the dirty state of the working directory.
         if any(wctx.sub(s).dirty() for s in wctx.substate):
             m1['.hgsubstate'] = modifiednodeid