changeset 47484:e6b303eb8f7d

dirstate: split a not-so-one-liner This is shorter and simpler to read. Differential Revision: https://phab.mercurial-scm.org/D10923
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Thu, 01 Jul 2021 18:56:34 +0200
parents ca8121d26732
children f93298a48da1
files mercurial/dirstate.py
diffstat 1 files changed, 2 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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)