##// END OF EJS Templates
test-rollback: Ignore hook exit code...
Mads Kiilerich -
r10081:a5f3f9b1 default
parent child Browse files
Show More
@@ -1,48 +1,48 b''
1 1 #!/bin/sh
2 2
3 3 mkdir t
4 4 cd t
5 5 hg init
6 6 echo a > a
7 7 hg add a
8 8 hg commit -m "test" -d "1000000 0"
9 9 hg verify
10 10 hg parents
11 11 hg status
12 12 hg rollback
13 13 hg verify
14 14 hg parents
15 15 hg status
16 16
17 17 echo % Test issue 902
18 18 hg commit -m "test2"
19 19 hg branch test
20 20 hg rollback
21 21 hg branch
22 22
23 23 echo '% Test issue 1635 (commit message saved)'
24 24 echo '.hg/last-message.txt:'
25 25 cat .hg/last-message.txt ; echo
26 26
27 27 echo % Test rollback of hg before issue 902 was fixed
28 28 hg commit -m "test3"
29 29 hg branch test
30 30 rm .hg/undo.branch
31 31 hg rollback
32 32 hg branch
33 33
34 34 echo '% rollback by pretxncommit saves commit message (issue 1635)'
35 35 echo a >> a
36 hg --config hooks.pretxncommit=false commit -m"precious commit message"
36 hg --config hooks.pretxncommit=false commit -m"precious commit message" 2>&1 | sed 's,exited with status .*,exited ...,g'
37 37 echo '.hg/last-message.txt:'
38 38 cat .hg/last-message.txt ; echo
39 39
40 40 echo '% same thing, but run $EDITOR'
41 41 cat > $HGTMP/editor <<'__EOF__'
42 42 #!/bin/sh
43 43 echo "another precious commit message" > "$1"
44 44 __EOF__
45 45 chmod +x $HGTMP/editor
46 HGEDITOR=$HGTMP/editor hg --config hooks.pretxncommit=false commit
46 HGEDITOR=$HGTMP/editor hg --config hooks.pretxncommit=false commit 2>&1 | sed 's,exited with status .*,exited ...,g'
47 47 echo '.hg/last-message.txt:'
48 48 cat .hg/last-message.txt
@@ -1,43 +1,43 b''
1 1 checking changesets
2 2 checking manifests
3 3 crosschecking files in changesets and manifests
4 4 checking files
5 5 1 files, 1 changesets, 1 total revisions
6 6 changeset: 0:0acdaf898367
7 7 tag: tip
8 8 user: test
9 9 date: Mon Jan 12 13:46:40 1970 +0000
10 10 summary: test
11 11
12 12 rolling back last transaction
13 13 checking changesets
14 14 checking manifests
15 15 crosschecking files in changesets and manifests
16 16 checking files
17 17 0 files, 0 changesets, 0 total revisions
18 18 A a
19 19 % Test issue 902
20 20 marked working directory as branch test
21 21 rolling back last transaction
22 22 default
23 23 % Test issue 1635 (commit message saved)
24 24 .hg/last-message.txt:
25 25 test2
26 26 % Test rollback of hg before issue 902 was fixed
27 27 marked working directory as branch test
28 28 rolling back last transaction
29 29 Named branch could not be reset, current branch still is: test
30 30 test
31 31 % rollback by pretxncommit saves commit message (issue 1635)
32 32 transaction abort!
33 33 rollback completed
34 abort: pretxncommit hook exited with status 1
34 abort: pretxncommit hook exited ...
35 35 .hg/last-message.txt:
36 36 precious commit message
37 37 % same thing, but run $EDITOR
38 38 transaction abort!
39 39 rollback completed
40 40 note: commit message saved in .hg/last-message.txt
41 abort: pretxncommit hook exited with status 1
41 abort: pretxncommit hook exited ...
42 42 .hg/last-message.txt:
43 43 another precious commit message
General Comments 0
You need to be logged in to leave comments. Login now