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 (11 lines) | |||
M | mercurial/mergestate.py (7 lines) |
Commit | Parents | Author | Summary | Date |
---|---|---|---|---|
0cd4c9dc5ee7 | 13ea3bbdd4ab | Pierre-Yves David | Sep 30 2021, 12: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 |
# in `test-graft.t` | # in `test-graft.t` | ||||
merged = False | merged = False | ||||
clean_p2 = True | 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: | ||||
if p1_tracked or self.get(filename) is not None: | pass | ||||
# XXX the `self.get` call is catching some case in | |||||
# `test-merge-remove.t` where the file is tracked in p1, the | |||||
# p1_tracked argument is False. | |||||
# | |||||
# In addition, this seems to be a case where the file is marked | |||||
# as merged without actually being the result of a merge | |||||
# action. So thing are not ideal here. | |||||
merged = True | |||||
clean_p2 = False | |||||
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 | ||||
elif possibly_dirty: | elif possibly_dirty: | ||||
pass | pass | ||||
elif wc_tracked: | elif wc_tracked: | ||||
# this is a "normal" file | # this is a "normal" file | ||||
if parentfiledata is None: | if parentfiledata is None: | ||||
msg = b'failed to pass parentfiledata for a normal file: %s' | msg = b'failed to pass parentfiledata for a normal file: %s' |
# keep new | # keep new | ||||
for f, args, msg in actions.get(ACTION_KEEP_NEW, []): | for f, args, msg in actions.get(ACTION_KEEP_NEW, []): | ||||
pass | pass | ||||
# get | # get | ||||
for f, args, msg in actions.get(ACTION_GET, []): | for f, args, msg in actions.get(ACTION_GET, []): | ||||
if branchmerge: | if branchmerge: | ||||
# tracked in p1 can be True also but update_file should not care | # tracked in p1 can be True also but update_file should not care | ||||
old_entry = repo.dirstate.get_entry(f) | |||||
p1_tracked = old_entry.any_tracked and not old_entry.added | |||||
repo.dirstate.update_file( | repo.dirstate.update_file( | ||||
f, | f, | ||||
p1_tracked=False, | p1_tracked=p1_tracked, | ||||
p2_tracked=True, | p2_tracked=True, | ||||
wc_tracked=True, | wc_tracked=True, | ||||
clean_p2=True, | clean_p2=not p1_tracked, | ||||
merged=p1_tracked, | |||||
) | ) | ||||
else: | else: | ||||
parentfiledata = getfiledata[f] if getfiledata else None | parentfiledata = getfiledata[f] if getfiledata else None | ||||
repo.dirstate.update_file( | repo.dirstate.update_file( | ||||
f, | f, | ||||
p1_tracked=True, | p1_tracked=True, | ||||
wc_tracked=True, | wc_tracked=True, | ||||
parentfiledata=parentfiledata, | parentfiledata=parentfiledata, |