D11551: dirstate: remove a update_file's special case for `merged` file
marmoute (Pierre-Yves David)
phabricator at mercurial-scm.org
Fri Oct 1 18:40:12 UTC 2021
marmoute created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.
REVISION SUMMARY
This case was fishy and can be dealt with by passing more accurate data a higher
level.
This clarify the API and prepare for a larger rework of the data we feeds to
the dirstate.
REPOSITORY
rHG Mercurial
BRANCH
default
REVISION DETAIL
https://phab.mercurial-scm.org/D11551
AFFECTED FILES
mercurial/dirstatemap.py
mercurial/mergestate.py
CHANGE DETAILS
diff --git a/mercurial/mergestate.py b/mercurial/mergestate.py
--- a/mercurial/mergestate.py
+++ b/mercurial/mergestate.py
@@ -821,8 +821,15 @@
if branchmerge:
# We've done a branch merge, mark this file as merged
# so that we properly record the merger later
+ p1_tracked = f1 == f
+ p2_tracked = f2 == f
repo.dirstate.update_file(
- f, p1_tracked=True, wc_tracked=True, merged=True
+ f,
+ p1_tracked=p1_tracked,
+ p2_tracked=p2_tracked,
+ wc_tracked=True,
+ merged=p1_tracked,
+ clean_p2=not p1_tracked,
)
if f1 != f2: # copy/rename
if move:
diff --git a/mercurial/dirstatemap.py b/mercurial/dirstatemap.py
--- a/mercurial/dirstatemap.py
+++ b/mercurial/dirstatemap.py
@@ -212,15 +212,7 @@
self.copymap.pop(filename, None)
return
elif merged:
- # XXX might be merged and removed ?
- entry = self.get(filename)
- if entry is None or not entry.tracked:
- # XXX mostly replicate dirstate.other parent. We should get
- # the higher layer to pass us more reliable data where `merged`
- # actually mean merged. Dropping this clause will show failure
- # in `test-graft.t`
- merged = False
- clean_p2 = True
+ pass
elif not (p1_tracked or p2_tracked) and wc_tracked:
pass # file is added, nothing special to adjust
elif (p1_tracked or p2_tracked) and not wc_tracked:
To: marmoute, #hg-reviewers
Cc: mercurial-patches, mercurial-devel
More information about the Mercurial-devel
mailing list