mergestate: simplify reset(), knowing that `other` and `node` go together
There's only one caller of `reset()` that passes any arguments at all,
and that originates from `merge.py:1371`. That code always passes
values for both `node` and `other`.
Differential Revision: https://phab.mercurial-scm.org/D9032
--- a/mercurial/mergestate.py Tue Sep 15 22:40:26 2020 -0700
+++ b/mercurial/mergestate.py Tue Sep 15 23:19:14 2020 -0700
@@ -202,15 +202,12 @@
def reset(self, node=None, other=None, labels=None):
self._state = {}
self._stateextras = collections.defaultdict(dict)
- self._local = None
- self._other = None
+ self._local = node
+ self._other = other
self._labels = labels
for var in ('localctx', 'otherctx'):
if var in vars(self):
delattr(self, var)
- if node:
- self._local = node
- self._other = other
self._readmergedriver = None
if self.mergedriver:
self._mdstate = MERGE_DRIVER_STATE_SUCCESS