hg update hint

Differential Revision: https://phab.mercurial-scm.org/D834
This commit is contained in:
Diego Caballero 2017-09-28 11:30:37 -07:00
parent 1ac1a987b3
commit 60ea7b5141
4 changed files with 11 additions and 0 deletions

View File

@ -433,6 +433,11 @@ def update(orig, ui, repo, node=None, rev=None, **kwargs):
if inactive:
extensions.unwrapfunction(hg, 'updatetotally', _wrapupdatetotally)
# If the command succeed a message for 'hg update .^' will appear
# suggesting to use hg prev
if node == '.^':
ui.status(_("(hint: use 'hg prev' to move to the parent changeset)\n"))
return result
def _wrapupdatetotally(orig, ui, repo, checkout, brev, *args, **kwargs):

View File

@ -20,6 +20,7 @@ Run test
$ hg up ".^"
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
(leaving bookmark AB)
(hint: use 'hg prev' to move to the parent changeset)
$ touch c
$ hg commit -Aqm c
$ hg bookmark C -t AB

View File

@ -23,6 +23,7 @@ Set up the repository.
|
o 0
$ hg up 3
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
@ -68,3 +69,6 @@ Certain flags shouldn't work together.
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg st
? foo
$ hg update .^
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
(hint: use 'hg prev' to move to the parent changeset)

View File

@ -79,6 +79,7 @@ Dirty update allowed to same rev, with no conflicts, and --clean
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg update ".^"
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
(hint: use 'hg prev' to move to the parent changeset)
$ hg update --clean 1
2 files updated, 0 files merged, 0 files removed, 0 files unresolved