changeset 45612:094a91a183f1

changing-files: record merged files at commit time The data is easy to gather at commit time, and we need it for changeset centric copy tracing. Right now, it is not persisted so we cannot use it. However we will fix this part very soon, gathering something to persist was necessary first. Differential Revision: https://phab.mercurial-scm.org/D9088
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Fri, 25 Sep 2020 02:01:32 +0200
parents e5578dbe36cb
children ddcee0b0fd67
files mercurial/commit.py
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commit.py	Thu Sep 24 09:50:09 2020 +0200
+++ b/mercurial/commit.py	Fri Sep 25 02:01:32 2020 +0200
@@ -181,6 +181,8 @@
                 if is_touched:
                     if is_touched == 'added':
                         files.mark_added(f)
+                    elif is_touched == 'merged':
+                        files.mark_merged(f)
                     else:
                         files.mark_touched(f)
                 m.setflag(f, fctx.flags())
@@ -347,7 +349,10 @@
     text = fctx.data()
     if fparent2 != nullid or meta or flog.cmp(fparent1, text) or force_new_node:
         if touched is None:  # do not overwrite added
-            touched = 'modified'
+            if fparent2 == nullid:
+                touched = 'modified'
+            else:
+                touched = 'merged'
         fnode = flog.add(text, meta, tr, linkrev, fparent1, fparent2)
     # are just the flags changed during merge?
     elif fname in manifest1 and manifest1.flags(fname) != fctx.flags():