Mercurial > public > mercurial-scm > hg-stable
diff mercurial/mergestate.py @ 48120:d4e715d2be0b
dirstate: remove a update_file's special case for tracked file with p2 data
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.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Thu, 30 Sep 2021 18:00:39 +0200 |
parents | 0e581d7e89b7 |
children | 2c2788ce0257 |
line wrap: on
line diff
--- a/mercurial/mergestate.py Wed Sep 29 02:34:32 2021 +0200 +++ b/mercurial/mergestate.py Thu Sep 30 18:00:39 2021 +0200 @@ -796,12 +796,15 @@ for f, args, msg in actions.get(ACTION_GET, []): if branchmerge: # 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( f, - p1_tracked=False, + p1_tracked=p1_tracked, p2_tracked=True, wc_tracked=True, - clean_p2=True, + clean_p2=not p1_tracked, + merged=p1_tracked, ) else: parentfiledata = getfiledata[f] if getfiledata else None