D10923: dirstate: split a not-so-one-liner

marmoute (Pierre-Yves David) phabricator at mercurial-scm.org
Fri Jul 2 15:17:25 UTC 2021


marmoute created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  This is shorter and simpler to read.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D10923

AFFECTED FILES
  mercurial/dirstate.py

CHANGE DETAILS

diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py
--- a/mercurial/dirstate.py
+++ b/mercurial/dirstate.py
@@ -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)



To: marmoute, #hg-reviewers
Cc: mercurial-patches, mercurial-devel


More information about the Mercurial-devel mailing list