Patchwork D6493: commit: make the error message more specific while aborting branch closing

login
register
mail settings
Submitter phabricator
Date June 18, 2019, 11:41 a.m.
Message ID <085b72378a246499e22dea474462fdaf@localhost.localdomain>
Download mbox | patch
Permalink /patch/40575/
State Not Applicable
Headers show

Comments

phabricator - June 18, 2019, 11:41 a.m.
Closed by commit rHGabd4783db5a7: commit: make the error message more specific while aborting branch closing (authored by khanchi97).
This revision was automatically updated to reflect the committed changes.

CHANGED PRIOR TO COMMIT
  https://phab.mercurial-scm.org/D6493?vs=15533&id=15568#toc

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6493?vs=15533&id=15568

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D6493/new/

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

AFFECTED FILES
  mercurial/commands.py
  tests/test-commit-amend.t

CHANGE DETAILS




To: khanchi97, #hg-reviewers, pulkit
Cc: mercurial-devel

Patch

diff --git a/tests/test-commit-amend.t b/tests/test-commit-amend.t
--- a/tests/test-commit-amend.t
+++ b/tests/test-commit-amend.t
@@ -892,7 +892,7 @@ 
   marked working directory as branch silliness
   $ echo b >> b
   $ hg ci --close-branch -m'open and close'
-  abort: can only close branch heads
+  abort: branch "silliness" has no heads to close
   [255]
 
 Test that amend with --secret creates new secret changeset forcibly
diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -1677,7 +1677,7 @@ 
             raise error.Abort(_('current revision is already a branch closing'
                                 ' head'))
         elif not bheads:
-            raise error.Abort(_('can only close branch heads'))
+            raise error.Abort(_('branch "%s" has no heads to close') % branch)
         elif branch == repo['.'].branch() and repo['.'].node() not in bheads:
             raise error.Abort(_('can only close branch heads'))
         elif opts.get('amend'):