Mercurial > hg
comparison mercurial/commands.py @ 44687:1b8fd4af3318
mergestate: store about files resolved in favour of other
Committing a merge sometimes wrongly creates a new filenode where it can re-use
an existing one. This happens because the commit code does it's own calculation
and does not know what happened on merge.
This starts storing information in mergestate about files which were
automatically merged and the other/remote version of file was used.
We need this information at commit to pick the filenode parent for the new
commit.
This issue was found by Pierre-Yves David and idea to store the relevant parts
in mergestate is also suggested by him.
Somethings which can be further investigated are:
1) refactoring of commit logic more to depend on this information
2) maybe a more generic solution?
Differential Revision: https://phab.mercurial-scm.org/D8392
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Thu, 09 Apr 2020 16:06:03 +0530 |
parents | 47c1226463a1 |
children | 16c361152133 |
comparison
equal
deleted
inserted
replaced
44686:bca57ad9e630 | 44687:1b8fd4af3318 |
---|---|
5953 | 5953 |
5954 for f in ms: | 5954 for f in ms: |
5955 if not m(f): | 5955 if not m(f): |
5956 continue | 5956 continue |
5957 | 5957 |
5958 if ms[f] == mergemod.MERGE_RECORD_MERGED_OTHER: | |
5959 continue | |
5958 label, key = mergestateinfo[ms[f]] | 5960 label, key = mergestateinfo[ms[f]] |
5959 fm.startitem() | 5961 fm.startitem() |
5960 fm.context(ctx=wctx) | 5962 fm.context(ctx=wctx) |
5961 fm.condwrite(not nostatus, b'mergestatus', b'%s ', key, label=label) | 5963 fm.condwrite(not nostatus, b'mergestatus', b'%s ', key, label=label) |
5962 fm.data(path=f) | 5964 fm.data(path=f) |
5999 for f in ms: | 6001 for f in ms: |
6000 if not m(f): | 6002 if not m(f): |
6001 continue | 6003 continue |
6002 | 6004 |
6003 didwork = True | 6005 didwork = True |
6006 | |
6007 if ms[f] == mergemod.MERGE_RECORD_MERGED_OTHER: | |
6008 continue | |
6004 | 6009 |
6005 # don't let driver-resolved files be marked, and run the conclude | 6010 # don't let driver-resolved files be marked, and run the conclude |
6006 # step if asked to resolve | 6011 # step if asked to resolve |
6007 if ms[f] == mergemod.MERGE_RECORD_DRIVER_RESOLVED: | 6012 if ms[f] == mergemod.MERGE_RECORD_DRIVER_RESOLVED: |
6008 exact = m.exact(f) | 6013 exact = m.exact(f) |