Mercurial > hg
changeset 19934:bfc6ed892349
push: hide description about "-f" in the hint to prevent from using it easily
"use push -f to force" in the hint at abortion of "hg push" may cause
novice users to execute "push -f" easily without understanding about
problems of multiple branch heads in the repository.
This patch hides description about "-f" in the hint, and leads into
seeing "hg help push" for details about pushing new heads.
author | FUJIWARA Katsunori <foozy@lares.dti.ne.jp> |
---|---|
date | Thu, 03 Oct 2013 23:16:06 +0900 |
parents | 621a26eb3a99 |
children | 4f53de036af8 |
files | mercurial/discovery.py tests/test-bookmarks-pushpull.t tests/test-obsolete-checkheads.t tests/test-phases-exchange.t tests/test-push-warn.t tests/test-subrepo.t |
diffstat | 6 files changed, 25 insertions(+), 23 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/discovery.py Sat Oct 05 01:02:22 2013 +0900 +++ b/mercurial/discovery.py Thu Oct 03 23:16:06 2013 +0900 @@ -330,11 +330,13 @@ error = _("push creates new remote head %s!" ) % short(dhs[0]) if heads[2]: # unsynced - hint = _("you should pull and merge or " - "use push -f to force") + hint = _("pull and merge or" + " see \"hg help push\" for details about" + " pushing new heads") else: - hint = _("did you forget to merge? " - "use push -f to force") + hint = _("merge or" + " see \"hg help push\" for details about" + " pushing new heads") if branch is not None: repo.ui.note(_("new remote heads on branch '%s'\n") % branch) for h in dhs:
--- a/tests/test-bookmarks-pushpull.t Sat Oct 05 01:02:22 2013 +0900 +++ b/tests/test-bookmarks-pushpull.t Thu Oct 03 23:16:06 2013 +0900 @@ -275,7 +275,7 @@ pushing to http://localhost:$HGPORT2/ searching for changes abort: push creates new remote head c922c0139ca0! - (did you forget to merge? use push -f to force) + (merge or see "hg help push" for details about pushing new heads) [255] $ hg -R ../a book @ 1:0d2164f0ce0d @@ -291,7 +291,7 @@ pushing to http://localhost:$HGPORT2/ searching for changes abort: push creates new remote head c922c0139ca0! - (did you forget to merge? use push -f to force) + (merge or see "hg help push" for details about pushing new heads) [255] $ hg -R ../a book @ 1:0d2164f0ce0d
--- a/tests/test-obsolete-checkheads.t Sat Oct 05 01:02:22 2013 +0900 +++ b/tests/test-obsolete-checkheads.t Thu Oct 03 23:16:06 2013 +0900 @@ -98,7 +98,7 @@ pushing to $TESTTMP/remote (glob) searching for changes abort: push creates new remote head 71e3228bffe1! - (did you forget to merge? use push -f to force) + (merge or see "hg help push" for details about pushing new heads) [255] old head is now public (public remote version) @@ -127,7 +127,7 @@ # pushing to $TESTTMP/remote # searching for changes # abort: push creates new remote head 71e3228bffe1! -# (did you forget to merge? use push -f to force) +# (merge or see "hg help push" for details about pushing new heads) # [255] old head is obsolete but replacement is not pushed @@ -158,7 +158,7 @@ pushing to $TESTTMP/remote (glob) searching for changes abort: push creates new remote head d7d41ccbd4de! - (did you forget to merge? use push -f to force) + (merge or see "hg help push" for details about pushing new heads) [255]
--- a/tests/test-phases-exchange.t Sat Oct 05 01:02:22 2013 +0900 +++ b/tests/test-phases-exchange.t Thu Oct 03 23:16:06 2013 +0900 @@ -844,7 +844,7 @@ pushing to ../mu searching for changes abort: push creates new remote head 435b5d83910c! - (did you forget to merge? use push -f to force) + (merge or see "hg help push" for details about pushing new heads) [255] $ hg push -fr 435b5d83910c ../mu # because the push will create new visible head pushing to ../mu
--- a/tests/test-push-warn.t Sat Oct 05 01:02:22 2013 +0900 +++ b/tests/test-push-warn.t Thu Oct 03 23:16:06 2013 +0900 @@ -26,7 +26,7 @@ pushing to ../a searching for changes abort: push creates new remote head 1e108cc5548c! - (you should pull and merge or use push -f to force) + (pull and merge or see "hg help push" for details about pushing new heads) [255] $ hg push --debug ../a @@ -41,7 +41,7 @@ new remote heads on branch 'default' new remote head 1e108cc5548c abort: push creates new remote head 1e108cc5548c! - (you should pull and merge or use push -f to force) + (pull and merge or see "hg help push" for details about pushing new heads) [255] $ hg pull ../a @@ -57,7 +57,7 @@ pushing to ../a searching for changes abort: push creates new remote head 1e108cc5548c! - (did you forget to merge? use push -f to force) + (merge or see "hg help push" for details about pushing new heads) [255] $ hg merge @@ -110,7 +110,7 @@ pushing to ../c searching for changes abort: push creates new remote head 6346d66eb9f5! - (did you forget to merge? use push -f to force) + (merge or see "hg help push" for details about pushing new heads) [255] $ hg push -r 2 ../c @@ -123,7 +123,7 @@ pushing to ../c searching for changes abort: push creates new remote head a5dda829a167! - (did you forget to merge? use push -f to force) + (merge or see "hg help push" for details about pushing new heads) [255] $ hg push -v -r 3 -r 4 ../c @@ -133,7 +133,7 @@ new remote head a5dda829a167 new remote head ee8fbc7a0295 abort: push creates new remote head a5dda829a167! - (did you forget to merge? use push -f to force) + (merge or see "hg help push" for details about pushing new heads) [255] $ hg push -v -f -r 3 -r 4 ../c @@ -263,7 +263,7 @@ pushing to ../f searching for changes abort: push creates new remote head 0b715ef6ff8f on branch 'a'! - (did you forget to merge? use push -f to force) + (merge or see "hg help push" for details about pushing new heads) [255] Push replacement head on existing branches: @@ -409,7 +409,7 @@ pushing to h searching for changes abort: push creates new remote head 97bd0c84d346! - (you should pull and merge or use push -f to force) + (pull and merge or see "hg help push" for details about pushing new heads) [255] @@ -481,7 +481,7 @@ pushing to ../l searching for changes abort: push creates new remote head 451211cc22b0 on branch 'a'! - (did you forget to merge? use push -f to force) + (merge or see "hg help push" for details about pushing new heads) [255] $ cd .. @@ -736,14 +736,14 @@ pushing to inner searching for changes abort: push creates new remote head 7d0f4fb6cf04 on branch 'A'! - (did you forget to merge? use push -f to force) + (merge or see "hg help push" for details about pushing new heads) [255] $ hg push inner -r4 -r5 pushing to inner searching for changes abort: push creates new remote head 7d0f4fb6cf04 on branch 'A'! - (did you forget to merge? use push -f to force) + (merge or see "hg help push" for details about pushing new heads) [255] $ hg in inner
--- a/tests/test-subrepo.t Sat Oct 05 01:02:22 2013 +0900 +++ b/tests/test-subrepo.t Thu Oct 03 23:16:06 2013 +0900 @@ -317,7 +317,7 @@ pushing subrepo s to $TESTTMP/t/s searching for changes abort: push creates new remote head 12a213df6fa9! (in subrepo s) - (did you forget to merge? use push -f to force) + (merge or see "hg help push" for details about pushing new heads) [255] $ hg push -f pushing to $TESTTMP/t (glob) @@ -716,7 +716,7 @@ $ hg -R repo2 ci -m3 $ hg -q -R repo2 push abort: push creates new remote head cc505f09a8b2! (in subrepo s) - (did you forget to merge? use push -f to force) + (merge or see "hg help push" for details about pushing new heads) [255] $ hg -R repo update 0 files updated, 0 files merged, 0 files removed, 0 files unresolved