mercurial/merge.py
changeset 38426 00368bc0a614
parent 38373 ef692614e601
parent 38425 1322ae04d3d7
child 38494 d4be8ea8f22d
--- a/mercurial/merge.py	Tue Jun 19 13:49:06 2018 -0700
+++ b/mercurial/merge.py	Thu Jun 21 09:32:31 2018 -0700
@@ -1150,8 +1150,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