D6038: push: added clear warning message when pushing a closed branch(issue6080)

taapas1128 (Taapas Agrawal) phabricator at mercurial-scm.org
Thu Feb 28 19:15:53 UTC 2019


taapas1128 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/discovery.py
  tests/test-push-warn.t
  tests/test-treediscovery-legacy.t
  tests/test-treediscovery.t

CHANGE DETAILS

diff --git a/tests/test-treediscovery.t b/tests/test-treediscovery.t
--- a/tests/test-treediscovery.t
+++ b/tests/test-treediscovery.t
@@ -269,7 +269,7 @@
   $ hg push $remote
   pushing to http://localhost:$HGPORT/
   searching for changes
-  abort: push creates new remote branches: both, name1!
+  abort: push creates new remote branches:both, name1(now closed)!
   (use 'hg push --new-branch' to create new remote branches)
   [255]
   $ hg push $remote --new-branch
diff --git a/tests/test-treediscovery-legacy.t b/tests/test-treediscovery-legacy.t
--- a/tests/test-treediscovery-legacy.t
+++ b/tests/test-treediscovery-legacy.t
@@ -285,7 +285,7 @@
   $ hg push $remote
   pushing to http://localhost:$HGPORT/
   searching for changes
-  abort: push creates new remote branches: both, name1!
+  abort: push creates new remote branches:both, name1(now closed)!
   (use 'hg push --new-branch' to create new remote branches)
   [255]
   $ hg push $remote --new-branch
diff --git a/tests/test-push-warn.t b/tests/test-push-warn.t
--- a/tests/test-push-warn.t
+++ b/tests/test-push-warn.t
@@ -232,14 +232,14 @@
   $ hg push ../f
   pushing to ../f
   searching for changes
-  abort: push creates new remote branches: c!
+  abort: push creates new remote branches:c(now closed)!
   (use 'hg push --new-branch' to create new remote branches)
   [255]
 
   $ hg push -r 4 -r 5 ../f
   pushing to ../f
   searching for changes
-  abort: push creates new remote branches: c!
+  abort: push creates new remote branches:c(now closed)!
   (use 'hg push --new-branch' to create new remote branches)
   [255]
 
@@ -253,14 +253,14 @@
   $ hg push ../f
   pushing to ../f
   searching for changes
-  abort: push creates new remote branches: c, d!
+  abort: push creates new remote branches:c, d(now closed)!
   (use 'hg push --new-branch' to create new remote branches)
   [255]
 
   $ hg push -r 4 -r 6 ../f
   pushing to ../f
   searching for changes
-  abort: push creates new remote branches: c, d!
+  abort: push creates new remote branches:c, d(now closed)!
   (use 'hg push --new-branch' to create new remote branches)
   [255]
 
@@ -353,7 +353,7 @@
   $ hg push -r 12 -r 13 ../f
   pushing to ../f
   searching for changes
-  abort: push creates new remote branches: e!
+  abort: push creates new remote branches:e(now closed)!
   (use 'hg push --new-branch' to create new remote branches)
   [255]
 
@@ -477,7 +477,7 @@
   $ hg -R k push -r a j
   pushing to j
   searching for changes
-  abort: push creates new remote branches: b!
+  abort: push creates new remote branches:b(now closed)!
   (use 'hg push --new-branch' to create new remote branches)
   [255]
 
diff --git a/mercurial/discovery.py b/mercurial/discovery.py
--- a/mercurial/discovery.py
+++ b/mercurial/discovery.py
@@ -347,8 +347,8 @@
     # 1. Check for new branches on the remote.
     if newbranches and not newbranch:  # new branch requires --new-branch
         branchnames = ', '.join(sorted(newbranches))
-        raise error.Abort(_("push creates new remote branches: %s!")
-                           % branchnames,
+        raise error.Abort(_("push creates new remote branches:"
+                            "%s(now closed)!")% branchnames,
                          hint=_("use 'hg push --new-branch' to create"
                                 " new remote branches"))
 



To: taapas1128, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list