dirstate: split a not-so-one-liner
authorPierre-Yves David <pierre-yves.david@octobus.net>
Thu, 01 Jul 2021 18:56:34 +0200
changeset 47479 e6b303eb8f7d
parent 47478 ca8121d26732
child 47480 f93298a48da1
dirstate: split a not-so-one-liner This is shorter and simpler to read. Differential Revision: https://phab.mercurial-scm.org/D10923
mercurial/dirstate.py
--- a/mercurial/dirstate.py	Mon Jun 28 16:50:19 2021 +0200
+++ b/mercurial/dirstate.py	Thu Jul 01 18:56:34 2021 +0200
@@ -502,9 +502,8 @@
     def otherparent(self, f):
         '''Mark as coming from the other parent, always dirty.'''
         if self._pl[1] == self._nodeconstants.nullid:
-            raise error.Abort(
-                _(b"setting %r to other parent only allowed in merges") % f
-            )
+            msg = _(b"setting %r to other parent only allowed in merges") % f
+            raise error.Abort(msg)
         if f in self and self[f] == b'n':
             # merge-like
             self._addpath(f, b'm', 0, -2, -1)