Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/commands.py @ 45402:0652a533fe3c
mergestate: use _stateextras instead of merge records for commit related info
There is a set of information related to a merge which is needed on commit. We
want to store such information in the mergestate so that we can read it while
committing.
For this purpose, we are using merge records and introduced a merge
entry state for that. However this won't scale and is not clean way to implement
this.
This patch reworks the existing logic related to this to use _stateextras and
read from it.
Right now the information stored is not very descriptive but it will be in next
patch.
Using _stateextras also makes MERGE_RECORD_MERGED_OTHER useless and only to be
kept for BC.
Differential Revision: https://phab.mercurial-scm.org/D8920
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Mon, 10 Aug 2020 15:29:02 +0530 |
parents | 8c466bcb0879 |
children | e47385ef4e17 |
comparison
equal
deleted
inserted
replaced
45401:ede4c121239e | 45402:0652a533fe3c |
---|---|
5967 | 5967 |
5968 for f in ms: | 5968 for f in ms: |
5969 if not m(f): | 5969 if not m(f): |
5970 continue | 5970 continue |
5971 | 5971 |
5972 if ms[f] == mergestatemod.MERGE_RECORD_MERGED_OTHER: | |
5973 continue | |
5974 label, key = mergestateinfo[ms[f]] | 5972 label, key = mergestateinfo[ms[f]] |
5975 fm.startitem() | 5973 fm.startitem() |
5976 fm.context(ctx=wctx) | 5974 fm.context(ctx=wctx) |
5977 fm.condwrite(not nostatus, b'mergestatus', b'%s ', key, label=label) | 5975 fm.condwrite(not nostatus, b'mergestatus', b'%s ', key, label=label) |
5978 fm.data(path=f) | 5976 fm.data(path=f) |
6015 for f in ms: | 6013 for f in ms: |
6016 if not m(f): | 6014 if not m(f): |
6017 continue | 6015 continue |
6018 | 6016 |
6019 didwork = True | 6017 didwork = True |
6020 | |
6021 if ms[f] == mergestatemod.MERGE_RECORD_MERGED_OTHER: | |
6022 continue | |
6023 | 6018 |
6024 # don't let driver-resolved files be marked, and run the conclude | 6019 # don't let driver-resolved files be marked, and run the conclude |
6025 # step if asked to resolve | 6020 # step if asked to resolve |
6026 if ms[f] == mergestatemod.MERGE_RECORD_DRIVER_RESOLVED: | 6021 if ms[f] == mergestatemod.MERGE_RECORD_DRIVER_RESOLVED: |
6027 exact = m.exact(f) | 6022 exact = m.exact(f) |