Patchwork D12104: merge: break up a not-so-one-liner for readability

login
register
mail settings
Submitter phabricator
Date Jan. 29, 2022, 2:14 p.m.
Message ID <differential-rev-PHID-DREV-fqne2s6663ofwgqcdzrx-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/50430/
State New
Headers show

Comments

phabricator - Jan. 29, 2022, 2:14 p.m.
marmoute created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  (even if not fully satisfied this time)

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/merge.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/merge.py b/mercurial/merge.py
--- a/mercurial/merge.py
+++ b/mercurial/merge.py
@@ -530,14 +530,12 @@ 
         elif action[0] in mergestatemod.NO_OP_ACTIONS:
             mresult.removefile(f)  # merge does not affect file
         elif action[0] in nonconflicttypes:
-            raise error.Abort(
-                _(
-                    b'merge affects file \'%s\' outside narrow, '
-                    b'which is not yet supported'
-                )
-                % f,
-                hint=_(b'merging in the other direction may work'),
+            msg = _(
+                b'merge affects file \'%s\' outside narrow, '
+                b'which is not yet supported'
             )
+            hint = _(b'merging in the other direction may work')
+            raise error.Abort(msg % f, hint=hint)
         else:
             raise error.StateError(
                 _(b'conflict in file \'%s\' is outside narrow clone') % f