# HG changeset patch # User Martin von Zweigbergk # Date 1600237154 25200 # Node ID aad11a26a054f7d90e72a726ac2a95e37959a9f0 # Parent 0ce6af73f48103614d3e655d06c853e6ee4504d1 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 diff -r 0ce6af73f481 -r aad11a26a054 mercurial/mergestate.py --- 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