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