Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/merge.py @ 45304:f1fb9a079131
merge: add removefile() to mergeresult object
There are cases where some further calculation makes the file not needing to be
merged anymore and hence needs to be dropped in mergeresult object. This adds a
function for that.
Differential Revision: https://phab.mercurial-scm.org/D8821
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Fri, 24 Jul 2020 16:23:55 +0530 |
parents | b442920ab1de |
children | 31c454a5f1a8 |
comparison
equal
deleted
inserted
replaced
45303:b442920ab1de | 45304:f1fb9a079131 |
---|---|
573 action: one of mergestatemod.ACTION_* | 573 action: one of mergestatemod.ACTION_* |
574 data: a tuple of information like fctx and ctx related to this merge | 574 data: a tuple of information like fctx and ctx related to this merge |
575 message: a message about the merge | 575 message: a message about the merge |
576 """ | 576 """ |
577 self._actions[filename] = (action, data, message) | 577 self._actions[filename] = (action, data, message) |
578 | |
579 def removefile(self, filename): | |
580 """ removes a file from the mergeresult object as the file might | |
581 not merging anymore """ | |
582 del self._actions[filename] | |
578 | 583 |
579 @property | 584 @property |
580 def actions(self): | 585 def actions(self): |
581 return self._actions | 586 return self._actions |
582 | 587 |
1927 mergestatemod.ACTION_GET, | 1932 mergestatemod.ACTION_GET, |
1928 (flags, False), | 1933 (flags, False), |
1929 b'prompt recreating', | 1934 b'prompt recreating', |
1930 ) | 1935 ) |
1931 else: | 1936 else: |
1932 del mresult.actions[f] | 1937 mresult.removefile(f) |
1933 | 1938 |
1934 # Convert to dictionary-of-lists format | 1939 # Convert to dictionary-of-lists format |
1935 actions = mresult.actionsdict | 1940 actions = mresult.actionsdict |
1936 | 1941 |
1937 if not util.fscasesensitive(repo.path): | 1942 if not util.fscasesensitive(repo.path): |