Patchwork D12108: 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-snyewnpewoo7fdcr6d3e-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/50434/
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.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

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
@@ -1927,10 +1927,9 @@ 
                 raise error.Abort(m_a)
             elif pas == [p1]:
                 if not mergeancestor and wc.branch() == p2.branch():
-                    raise error.Abort(
-                        _(b"nothing to merge"),
-                        hint=_(b"use 'hg update' or check 'hg heads'"),
-                    )
+                    msg = _(b"nothing to merge")
+                    hint = _(b"use 'hg update' or check 'hg heads'")
+                    raise error.Abort(msg, hint=hint)
             if not force and (wc.files() or wc.deleted()):
                 raise error.StateError(
                     _(b"uncommitted changes"),