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

login
register
mail settings
Submitter phabricator
Date July 2, 2021, 3:17 p.m.
Message ID <differential-rev-PHID-DREV-yommr3r5jcmixfxkjwfh-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/49237/
State Superseded
Headers show

Comments

phabricator - July 2, 2021, 3:17 p.m.
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




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

Patch

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)