comparison mercurial/commit.py @ 45715:0428978bca22

mergestate: add `allextras()` to get all extras `extras()` can only be used for getting extra for a file. However at couple of places in code, we wanted to iterate over all the extras stored with the mergestate and they were accessing the private `_stateextras`. We add a new function for this. Differential Revision: https://phab.mercurial-scm.org/D9190
author Pulkit Goyal <7895pulkit@gmail.com>
date Sat, 10 Oct 2020 12:43:04 +0530
parents 60c46cc28bf4
children 067707e026b4 5d65e04b6a80
comparison
equal deleted inserted replaced
45714:ecf6d7aa874b 45715:0428978bca22
153 not enabled """ 153 not enabled """
154 salvaged = [] 154 salvaged = []
155 copy_sd = repo.filecopiesmode == b'changeset-sidedata' 155 copy_sd = repo.filecopiesmode == b'changeset-sidedata'
156 if copy_sd and len(ctx.parents()) > 1: 156 if copy_sd and len(ctx.parents()) > 1:
157 if ms.active(): 157 if ms.active():
158 for fname in sorted(ms._stateextras.keys()): 158 for fname in sorted(ms.allextras().keys()):
159 might_removed = ms.extras(fname).get(b'merge-removal-candidate') 159 might_removed = ms.extras(fname).get(b'merge-removal-candidate')
160 if might_removed == b'yes': 160 if might_removed == b'yes':
161 if fname in ctx: 161 if fname in ctx:
162 salvaged.append(fname) 162 salvaged.append(fname)
163 return salvaged 163 return salvaged