From patchwork Sat Mar 2 07:14:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: D6038: push: added clear warning message when pushing a closed branch(issue6080) From: phabricator X-Patchwork-Id: 38992 Message-Id: <07799da9bba37cacbe45d82dcd644553@localhost.localdomain> To: mercurial-devel@mercurial-scm.org Date: Sat, 2 Mar 2019 07:14:46 +0000 taapas1128 updated this revision to Diff 14290. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D6038?vs=14276&id=14290 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: mharbison72, mercurial-devel 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"))