fbamend: change hint text to suggest running restack

Summary: Instead of referencing `hg rebase` --restack option, just reference the `restack` subcommand.

Test Plan:
1. Make a few commits 1, 2, 3, 4 on any branch
2. `hg update 1`
3. Try to amend commit 1
4. Warning message should appear about children left behind
expected: Hint text does not mention `hg rebase --restack`

Reviewers: durham, kulshrax

Reviewed By: kulshrax

Subscribers: medson, mjpieters, kkrewink

Differential Revision: https://phabricator.intern.facebook.com/D5313108

Tasks: 19601780

Signature: t1:5313108:1498249314:98f31f4424341ef51997687293bf99b7297b6cd0
This commit is contained in:
Therin Irwin 2017-06-26 07:31:28 -07:00
parent a5b66da81e
commit 66b64d8fb6
8 changed files with 40 additions and 41 deletions

View File

@ -267,8 +267,7 @@ def amend(ui, repo, *pats, **opts):
else:
_usereducation(ui)
ui.warn(msg)
ui.status(_("(use 'hg rebase --restack' (alias: 'hg restack') "
"to rebase them)\n"))
ui.status(_("(use 'hg restack' to rebase them)\n"))
newbookmarks = repo._bookmarks

View File

@ -36,7 +36,7 @@ Rebasing single changeset.
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg amend -m "amended"
warning: the changeset's children were left behind
(use 'hg rebase --restack' (alias: 'hg restack') to rebase them)
(use 'hg restack' to rebase them)
$ hg next
abort: current changeset has no children
[255]
@ -65,7 +65,7 @@ Rebasing multiple changesets at once.
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg amend -m "amended"
warning: the changeset's children were left behind
(use 'hg rebase --restack' (alias: 'hg restack') to rebase them)
(use 'hg restack' to rebase them)
$ hg next --rebase --top
rebasing 2:776c07fa2b12 "r2"
rebasing 3:137d867d71d5 "r3"
@ -91,7 +91,7 @@ Rebasing a stack one changeset at a time.
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg amend -m "amended"
warning: the changeset's children were left behind
(use 'hg rebase --restack' (alias: 'hg restack') to rebase them)
(use 'hg restack' to rebase them)
$ hg next --rebase
rebasing 2:776c07fa2b12 "r2"
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
@ -141,7 +141,7 @@ Rebasing a stack two changesets at a time.
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg amend -m "amended"
warning: the changeset's children were left behind
(use 'hg rebase --restack' (alias: 'hg restack') to rebase them)
(use 'hg restack' to rebase them)
$ hg next --rebase 2
rebasing 2:776c07fa2b12 "r2"
rebasing 3:137d867d71d5 "r3"
@ -192,7 +192,7 @@ Rebasing after multiple amends.
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg amend -m "amend 1"
warning: the changeset's children were left behind
(use 'hg rebase --restack' (alias: 'hg restack') to rebase them)
(use 'hg restack' to rebase them)
$ hg amend -m "amend 2"
$ hg amend -m "amend 3"
$ showgraph
@ -233,7 +233,7 @@ Rebasing from below the amended changeset with the --newest flag.
3 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg amend -m "amended"
warning: the changeset's children were left behind
(use 'hg rebase --restack' (alias: 'hg restack') to rebase them)
(use 'hg restack' to rebase them)
$ hg up 0
0 files updated, 0 files merged, 2 files removed, 0 files unresolved
$ showgraph
@ -279,7 +279,7 @@ rolled back and the final state should be as it was before `hg next --rebase`.
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg amend -m "amended"
warning: the changeset's children were left behind
(use 'hg rebase --restack' (alias: 'hg restack') to rebase them)
(use 'hg restack' to rebase them)
$ mkcommit a
$ hg prev
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
@ -341,7 +341,7 @@ Test a situation where there is a conflict.
$ hg add c
$ hg amend -m "amended to add c"
warning: the changeset's children were left behind
(use 'hg rebase --restack' (alias: 'hg restack') to rebase them)
(use 'hg restack' to rebase them)
$ showgraph
@ 5 amended to add c
|

View File

@ -14,6 +14,6 @@ Perform restack without inhibit extension.
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg amend -m "Amended"
warning: the changeset's children were left behind
(use 'hg rebase --restack' (alias: 'hg restack') to rebase them)
(use 'hg restack' to rebase them)
$ hg rebase --restack
rebasing 2:* "r2" (glob)

View File

@ -59,7 +59,7 @@ Test basic case of a single amend in a small stack.
$ echo b >> b
$ hg amend
warning: the changeset's children were left behind
(use 'hg rebase --restack' (alias: 'hg restack') to rebase them)
(use 'hg restack' to rebase them)
$ showgraph
@ 5 add b
|
@ -99,7 +99,7 @@ Test multiple amends of same commit.
$ echo b >> b
$ hg amend
warning: the changeset's children were left behind
(use 'hg rebase --restack' (alias: 'hg restack') to rebase them)
(use 'hg restack' to rebase them)
$ echo b >> b
$ hg amend
$ showgraph
@ -132,7 +132,7 @@ Test conflict during rebasing.
$ hg add d
$ hg amend
warning: the changeset's children were left behind
(use 'hg rebase --restack' (alias: 'hg restack') to rebase them)
(use 'hg restack' to rebase them)
$ showgraph
@ 6 add b
|
@ -188,7 +188,7 @@ Test finding a stable base commit from within the old stack.
$ echo b >> b
$ hg amend
warning: the changeset's children were left behind
(use 'hg rebase --restack' (alias: 'hg restack') to rebase them)
(use 'hg restack' to rebase them)
$ hg up 3
3 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ showgraph
@ -224,7 +224,7 @@ Test finding a stable base commit from a new child of the amended commit.
$ echo b >> b
$ hg amend
warning: the changeset's children were left behind
(use 'hg rebase --restack' (alias: 'hg restack') to rebase them)
(use 'hg restack' to rebase them)
$ mkcommit e
$ showgraph
@ 6 add e
@ -264,7 +264,7 @@ a commit on top of one of the obsolete intermediate commits.
$ echo b >> b
$ hg amend
warning: the changeset's children were left behind
(use 'hg rebase --restack' (alias: 'hg restack') to rebase them)
(use 'hg restack' to rebase them)
$ mkcommit e
$ hg prev
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
@ -272,7 +272,7 @@ a commit on top of one of the obsolete intermediate commits.
$ echo b >> b
$ hg amend
warning: the changeset's children were left behind
(use 'hg rebase --restack' (alias: 'hg restack') to rebase them)
(use 'hg restack' to rebase them)
$ hg up 6
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ showgraph
@ -317,13 +317,13 @@ behavior is now incorrect -- restack should always fix the whole stack.)
$ echo b >> b
$ hg amend
warning: the changeset's children were left behind
(use 'hg rebase --restack' (alias: 'hg restack') to rebase them)
(use 'hg restack' to rebase them)
$ hg up 2
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ echo c >> c
$ hg amend
warning: the changeset's children were left behind
(use 'hg rebase --restack' (alias: 'hg restack') to rebase them)
(use 'hg restack' to rebase them)
$ hg up 3
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ showgraph
@ -365,7 +365,7 @@ below the current commit alone.
$ echo d >> d
$ hg amend
warning: the changeset's children were left behind
(use 'hg rebase --restack' (alias: 'hg restack') to rebase them)
(use 'hg restack' to rebase them)
$ hg up 0
0 files updated, 0 files merged, 3 files removed, 0 files unresolved
$ mkcommit f
@ -412,7 +412,7 @@ Test having an unamended commit.
$ echo b >> b
$ hg amend -m "Amended"
warning: the changeset's children were left behind
(use 'hg rebase --restack' (alias: 'hg restack') to rebase them)
(use 'hg restack' to rebase them)
$ echo b >> b
$ hg amend -m "Unamended"
$ hg unamend
@ -447,12 +447,12 @@ onto the newest successor of their parent.
[*] add b (glob)
$ hg amend -m "successor 1"
warning: the changeset's children were left behind
(use 'hg rebase --restack' (alias: 'hg restack') to rebase them)
(use 'hg restack' to rebase them)
$ hg up 1
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg amend -m "successor 2"
warning: the changeset's children were left behind
(use 'hg rebase --restack' (alias: 'hg restack') to rebase them)
(use 'hg restack' to rebase them)
$ hg up 1
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ showgraph
@ -489,13 +489,13 @@ since the successor is obsolete.
$ echo b >> b
$ hg amend
warning: the changeset's children were left behind
(use 'hg rebase --restack' (alias: 'hg restack') to rebase them)
(use 'hg restack' to rebase them)
$ hg up 1
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ echo c >> b
$ hg amend
warning: the changeset's children were left behind
(use 'hg rebase --restack' (alias: 'hg restack') to rebase them)
(use 'hg restack' to rebase them)
$ hg unamend
$ hg up -C 1
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
@ -528,13 +528,13 @@ Test recursive restacking -- basic case.
$ echo b >> b
$ hg amend
warning: the changeset's children were left behind
(use 'hg rebase --restack' (alias: 'hg restack') to rebase them)
(use 'hg restack' to rebase them)
$ hg up 2
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ echo c >> c
$ hg amend
warning: the changeset's children were left behind
(use 'hg rebase --restack' (alias: 'hg restack') to rebase them)
(use 'hg restack' to rebase them)
$ hg up 1
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
$ showgraph
@ -577,7 +577,7 @@ stack is lost upon rebasing lower levels.
$ echo b >> b
$ hg amend
warning: the changeset's children were left behind
(use 'hg rebase --restack' (alias: 'hg restack') to rebase them)
(use 'hg restack' to rebase them)
$ mkcommit e
$ mkcommit f
$ hg prev
@ -586,13 +586,13 @@ stack is lost upon rebasing lower levels.
$ echo e >> e
$ hg amend
warning: the changeset's children were left behind
(use 'hg rebase --restack' (alias: 'hg restack') to rebase them)
(use 'hg restack' to rebase them)
$ hg up 2
2 files updated, 0 files merged, 1 files removed, 0 files unresolved
$ echo c >> c
$ hg amend
warning: the changeset's children were left behind
(use 'hg rebase --restack' (alias: 'hg restack') to rebase them)
(use 'hg restack' to rebase them)
$ mkcommit g
$ mkcommit h
$ hg prev
@ -601,7 +601,7 @@ stack is lost upon rebasing lower levels.
$ echo g >> g
$ hg amend
warning: the changeset's children were left behind
(use 'hg rebase --restack' (alias: 'hg restack') to rebase them)
(use 'hg restack' to rebase them)
$ hg up 1
0 files updated, 0 files merged, 2 files removed, 0 files unresolved
$ showgraph

View File

@ -38,7 +38,7 @@ Test that no preamend bookmark is created.
0 files updated, 0 files merged, 2 files removed, 0 files unresolved
$ hg amend -m "amended"
warning: the changeset's children were left behind
(use 'hg rebase --restack' (alias: 'hg restack') to rebase them)
(use 'hg restack' to rebase them)
$ hg book
no bookmarks set

View File

@ -57,7 +57,7 @@ Test basic functions
$ echo a >> a
$ hg amend
warning: the changeset's children were left behind
(use 'hg rebase --restack' (alias: 'hg restack') to rebase them)
(use 'hg restack' to rebase them)
$ hg up 0
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ echo x >> x
@ -106,7 +106,7 @@ Test that bookmarked re-amends work well
user education
second line
warning: the changeset's children were left behind
(use 'hg rebase --restack' (alias: 'hg restack') to rebase them)
(use 'hg restack' to rebase them)
$ hg log -G -T '{node|short} {desc} {bookmarks}\n'
@ edf5fd2f5332 aa bm
|
@ -157,7 +157,7 @@ Test that unbookmarked re-amends work well
user education
second line
warning: the changeset's children were left behind
(use 'hg rebase --restack' (alias: 'hg restack') to rebase them)
(use 'hg restack' to rebase them)
$ hg log -G -T '{node|short} {desc} {bookmarks}\n'
@ 94eb429c9465 aa
|
@ -355,7 +355,7 @@ Fbamend respects the createmarkers option
user education
second line
warning: the changeset's children were left behind
(use 'hg rebase --restack' (alias: 'hg restack') to rebase them)
(use 'hg restack' to rebase them)
$ hg amend --fixup
rebasing the children of 3a4d2824efc1.preamend
rebasing 3:3166f3b5587d "commit --amend message"
@ -495,7 +495,7 @@ Test fbamend with inhibit
user education
second line
warning: the changeset's children were left behind
(use 'hg rebase --restack' (alias: 'hg restack') to rebase them)
(use 'hg restack' to rebase them)
$ hg amend --fixup
rebasing the children of f2d4abddbbcd.preamend
rebasing 2:4538525df7e2 "add c"

View File

@ -500,7 +500,7 @@ have createmarkers as we are creating instability
$ echo "mmm" >> cM
$ hg amend
warning: the changeset's children were left behind
(use 'hg rebase --restack' (alias: 'hg restack') to rebase them)
(use 'hg restack' to rebase them)
$ hg log -G
@ 18:210589181b14 add cM
|
@ -682,7 +682,7 @@ check that pruning and inhibited node does not confuse anything
$ echo "CM" > cM
$ hg amend
warning: the changeset's children were left behind
(use 'hg rebase --restack' (alias: 'hg restack') to rebase them)
(use 'hg restack' to rebase them)
$ hg log -G
@ 21:721c3c279519 add cM
|

View File

@ -19,7 +19,7 @@ with the inhibit extension enabled.
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg amend -m "amended"
warning: the changeset's children were left behind
(use 'hg rebase --restack' (alias: 'hg restack') to rebase them)
(use 'hg restack' to rebase them)
$ hg smartlog -T '{rev} {bookmarks}'
@ 4
|