Mercurial > public > mercurial-scm > hg
comparison mercurial/mergestate.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 | ecf6d7aa874b |
children | 89a2afe31e82 |
comparison
equal
deleted
inserted
replaced
45714:ecf6d7aa874b | 45715:0428978bca22 |
---|---|
304 MERGE_RECORD_UNRESOLVED, | 304 MERGE_RECORD_UNRESOLVED, |
305 MERGE_RECORD_UNRESOLVED_PATH, | 305 MERGE_RECORD_UNRESOLVED_PATH, |
306 ): | 306 ): |
307 yield f | 307 yield f |
308 | 308 |
309 def allextras(self): | |
310 """ return all extras information stored with the mergestate """ | |
311 return self._stateextras | |
312 | |
309 def extras(self, filename): | 313 def extras(self, filename): |
314 """ return extras stored with the mergestate for the given filename """ | |
310 return self._stateextras[filename] | 315 return self._stateextras[filename] |
311 | 316 |
312 def _resolve(self, preresolve, dfile, wctx): | 317 def _resolve(self, preresolve, dfile, wctx): |
313 """rerun merge process for file path `dfile`. | 318 """rerun merge process for file path `dfile`. |
314 Returns whether the merge was completed and the return value of merge | 319 Returns whether the merge was completed and the return value of merge |