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

login
register
mail settings
Submitter phabricator
Date Feb. 28, 2019, 8:46 p.m.
Message ID <faa52acb4a1e44f301f7346f327a9d9f@localhost.localdomain>
Download mbox | patch
Permalink /patch/38978/
State Not Applicable
Headers show

Comments

phabricator - Feb. 28, 2019, 8:46 p.m.
taapas1128 updated this revision to Diff 14276.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6038?vs=14275&id=14276

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




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

Patch

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(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(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(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(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(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(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(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(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(closed)!")% branchnames,
                          hint=_("use 'hg push --new-branch' to create"
                                 " new remote branches"))