Patchwork D9088: changing-files: record merged files at commit time

login
register
mail settings
Submitter phabricator
Date Sept. 26, 2020, 12:10 p.m.
Message ID <differential-rev-PHID-DREV-nf5c66skfjrimo3ymhj3-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/47290/
State Superseded
Headers show

Comments

phabricator - Sept. 26, 2020, 12:10 p.m.
marmoute created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  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.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D9088

AFFECTED FILES
  mercurial/commit.py

CHANGE DETAILS




To: marmoute, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/mercurial/commit.py b/mercurial/commit.py
--- a/mercurial/commit.py
+++ b/mercurial/commit.py
@@ -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())
@@ -336,7 +338,10 @@ 
     text = fctx.data()
     if fparent2 != nullid or meta or flog.cmp(fparent1, text):
         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():