changeset 45491:aad11a26a054

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
author Martin von Zweigbergk <martinvonz@google.com>
date Tue, 15 Sep 2020 23:19:14 -0700
parents 0ce6af73f481
children 08c6d6962b2a
files mercurial/mergestate.py
diffstat 1 files changed, 2 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- 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