Patchwork D11591: status: process `from_p2` file the same as `merged` one

login
register
mail settings
Submitter phabricator
Date Oct. 3, 2021, 12:40 a.m.
Message ID <differential-rev-PHID-DREV-iqd3eurxvpstnpx4ktdw-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/49915/
State Superseded
Headers show

Comments

phabricator - Oct. 3, 2021, 12:40 a.m.
marmoute created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  What matters here is that the file constains information coming from the second
  parent and should be considered `modified` on plain `hg status.
  
  So we can process `from_p2` file sooner. It also highlight that we probably
  don't need the merged/from_p2 distinction at higher level.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/dirstate.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py
--- a/mercurial/dirstate.py
+++ b/mercurial/dirstate.py
@@ -1372,7 +1372,7 @@ 
 
             if not st and t.tracked:
                 dadd(fn)
-            elif t.merged:
+            elif t.merged or t.from_p2:
                 madd(fn)
             elif t.added:
                 aadd(fn)
@@ -1385,7 +1385,6 @@ 
                         (size != st.st_size and size != st.st_size & _rangemask)
                         or ((mode ^ st.st_mode) & 0o100 and checkexec)
                     )
-                    or t.from_p2
                     or fn in copymap
                 ):
                     if stat.S_ISLNK(st.st_mode) and size != st.st_size: