##// END OF EJS Templates
rollback: clarifies the message about the reverted state (issue2628)...
rollback: clarifies the message about the reverted state (issue2628) Previously, when rolling back a transaction, some users could be confused between the level to which the store is rolled back, and the new parents of the working directory. $ hg rollback rolling back to revision 4 (undo commit) With this change: $ hg rollback repository tip rolled back to tip revision 4 (undo commit) working directory now based on revision 2 and 1 So now the user can realize that the store has been rolled back to an older tip, but also that the working directory may not on the tip (here we are rolling back the merge of the heads 2 and 1)

File last commit:

r13446:1e497df5 stable
r13446:1e497df5 stable
Show More
test-rollback.t
94 lines | 2.2 KiB | text/troff | Tads3Lexer
Matt Mackall
tests: unify test-rollback
r12485
$ mkdir t
$ cd t
$ hg init
$ echo a > a
$ hg add a
$ hg commit -m "test"
$ hg verify
checking changesets
checking manifests
crosschecking files in changesets and manifests
checking files
1 files, 1 changesets, 1 total revisions
$ hg parents
changeset: 0:acb14030fe0a
tag: tip
user: test
date: Thu Jan 01 00:00:00 1970 +0000
summary: test
$ hg status
$ hg rollback
Gilles Moris
rollback: clarifies the message about the reverted state (issue2628)...
r13446 repository tip rolled back to revision -1 (undo commit)
working directory now based on revision -1
Matt Mackall
tests: unify test-rollback
r12485 $ hg verify
checking changesets
checking manifests
crosschecking files in changesets and manifests
checking files
0 files, 0 changesets, 0 total revisions
$ hg parents
$ hg status
A a
Test issue 902
$ hg commit -m "test2"
$ hg branch test
marked working directory as branch test
$ hg rollback
Gilles Moris
rollback: clarifies the message about the reverted state (issue2628)...
r13446 repository tip rolled back to revision -1 (undo commit)
working directory now based on revision -1
Matt Mackall
tests: unify test-rollback
r12485 $ hg branch
default
Test issue 1635 (commit message saved)
.hg/last-message.txt:
$ cat .hg/last-message.txt ; echo
test2
Test rollback of hg before issue 902 was fixed
$ hg commit -m "test3"
$ hg branch test
marked working directory as branch test
$ rm .hg/undo.branch
$ hg rollback
Gilles Moris
rollback: clarifies the message about the reverted state (issue2628)...
r13446 repository tip rolled back to revision -1 (undo commit)
Matt Mackall
tests: unify test-rollback
r12485 Named branch could not be reset, current branch still is: test
Gilles Moris
rollback: clarifies the message about the reverted state (issue2628)...
r13446 working directory now based on revision -1
Matt Mackall
tests: unify test-rollback
r12485 $ hg branch
test
rollback by pretxncommit saves commit message (issue 1635)
$ echo a >> a
$ hg --config hooks.pretxncommit=false commit -m"precious commit message"
transaction abort!
rollback completed
abort: pretxncommit hook exited with status * (glob)
[255]
.hg/last-message.txt:
$ cat .hg/last-message.txt ; echo
precious commit message
Nicolas Dumazet
tests: clean up test-rollback.t...
r13185
same thing, but run $EDITOR
Mads Kiilerich
tests: remove the last traces of $HGTMP...
r12642 $ cat > editor << '__EOF__'
Matt Mackall
tests: unify test-rollback
r12485 > #!/bin/sh
> echo "another precious commit message" > "$1"
> __EOF__
Mads Kiilerich
tests: remove the last traces of $HGTMP...
r12642 $ chmod +x editor
$ HGEDITOR="'`pwd`'"/editor hg --config hooks.pretxncommit=false commit 2>&1
Matt Mackall
tests: unify test-rollback
r12485 transaction abort!
rollback completed
note: commit message saved in .hg/last-message.txt
abort: pretxncommit hook exited with status * (glob)
Mads Kiilerich
tests: remove the last traces of $HGTMP...
r12642 [255]
$ cat .hg/last-message.txt
Matt Mackall
tests: unify test-rollback
r12485 another precious commit message