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.
( )
Alphare | |
pulkit |
hg-reviewers |
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.
No Linters Available |
No Unit Test Coverage |
Path | Packages | |||
---|---|---|---|---|
M | mercurial/dirstatemap.py (10 lines) | |||
M | mercurial/mergestate.py (9 lines) |
Commit | Parents | Author | Summary | Date |
---|---|---|---|---|
ba9e72dd99bd | 0cd4c9dc5ee7 | Pierre-Yves David | Sep 30 2021, 6:00 PM |
Status | Author | Revision | |
---|---|---|---|
Abandoned | marmoute | ||
Abandoned | marmoute | ||
Abandoned | marmoute | ||
Abandoned | marmoute | ||
Abandoned | marmoute | ||
Abandoned | marmoute | ||
Abandoned | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute | ||
Closed | marmoute |
self.copymap.pop(filename, None) | self.copymap.pop(filename, None) | ||||
if not (p1_tracked or p2_tracked or wc_tracked): | if not (p1_tracked or p2_tracked or wc_tracked): | ||||
old_entry = self._map.pop(filename, None) | old_entry = self._map.pop(filename, None) | ||||
self._dirs_decr(filename, old_entry=old_entry) | self._dirs_decr(filename, old_entry=old_entry) | ||||
self.copymap.pop(filename, None) | self.copymap.pop(filename, None) | ||||
return | return | ||||
elif merged: | elif merged: | ||||
# XXX might be merged and removed ? | pass | ||||
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 | |||||
elif not (p1_tracked or p2_tracked) and wc_tracked: | elif not (p1_tracked or p2_tracked) and wc_tracked: | ||||
pass # file is added, nothing special to adjust | pass # file is added, nothing special to adjust | ||||
elif (p1_tracked or p2_tracked) and not wc_tracked: | elif (p1_tracked or p2_tracked) and not wc_tracked: | ||||
pass | pass | ||||
elif clean_p2 and wc_tracked: | elif clean_p2 and wc_tracked: | ||||
pass | pass | ||||
elif not p1_tracked and p2_tracked and wc_tracked: | elif not p1_tracked and p2_tracked and wc_tracked: | ||||
clean_p2 = True | clean_p2 = True |
) | ) | ||||
# merge | # merge | ||||
for f, args, msg in actions.get(ACTION_MERGE, []): | for f, args, msg in actions.get(ACTION_MERGE, []): | ||||
f1, f2, fa, move, anc = args | f1, f2, fa, move, anc = args | ||||
if branchmerge: | if branchmerge: | ||||
# We've done a branch merge, mark this file as merged | # We've done a branch merge, mark this file as merged | ||||
# so that we properly record the merger later | # so that we properly record the merger later | ||||
p1_tracked = f1 == f | |||||
p2_tracked = f2 == f | |||||
repo.dirstate.update_file( | 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 f1 != f2: # copy/rename | ||||
if move: | if move: | ||||
repo.dirstate.update_file( | repo.dirstate.update_file( | ||||
f1, p1_tracked=True, wc_tracked=False | f1, p1_tracked=True, wc_tracked=False | ||||
) | ) | ||||
if f1 != f: | if f1 != f: | ||||
repo.dirstate.copy(f1, f) | repo.dirstate.copy(f1, f) |