##// END OF EJS Templates
tests: unify test-rollback
Matt Mackall -
r12485:8fdc11fe default
parent child Browse files
Show More
@@ -1,48 +1,91 b''
1 #!/bin/sh
2
1
3 mkdir t
2 $ mkdir t
4 cd t
3 $ cd t
5 hg init
4 $ hg init
6 echo a > a
5 $ echo a > a
7 hg add a
6 $ hg add a
8 hg commit -m "test"
7 $ hg commit -m "test"
9 hg verify
8 $ hg verify
10 hg parents
9 checking changesets
11 hg status
10 checking manifests
12 hg rollback
11 crosschecking files in changesets and manifests
13 hg verify
12 checking files
14 hg parents
13 1 files, 1 changesets, 1 total revisions
15 hg status
14 $ hg parents
15 changeset: 0:acb14030fe0a
16 tag: tip
17 user: test
18 date: Thu Jan 01 00:00:00 1970 +0000
19 summary: test
20
21 $ hg status
22 $ hg rollback
23 rolling back to revision -1 (undo commit)
24 $ hg verify
25 checking changesets
26 checking manifests
27 crosschecking files in changesets and manifests
28 checking files
29 0 files, 0 changesets, 0 total revisions
30 $ hg parents
31 $ hg status
32 A a
16
33
17 echo % Test issue 902
34 Test issue 902
18 hg commit -m "test2"
35
19 hg branch test
36 $ hg commit -m "test2"
20 hg rollback
37 $ hg branch test
21 hg branch
38 marked working directory as branch test
39 $ hg rollback
40 rolling back to revision -1 (undo commit)
41 $ hg branch
42 default
43
44 Test issue 1635 (commit message saved)
45 .hg/last-message.txt:
22
46
23 echo '% Test issue 1635 (commit message saved)'
47 $ cat .hg/last-message.txt ; echo
24 echo '.hg/last-message.txt:'
48 test2
25 cat .hg/last-message.txt ; echo
49
50 Test rollback of hg before issue 902 was fixed
26
51
27 echo % Test rollback of hg before issue 902 was fixed
52 $ hg commit -m "test3"
28 hg commit -m "test3"
53 $ hg branch test
29 hg branch test
54 marked working directory as branch test
30 rm .hg/undo.branch
55 $ rm .hg/undo.branch
31 hg rollback
56 $ hg rollback
32 hg branch
57 rolling back to revision -1 (undo commit)
58 Named branch could not be reset, current branch still is: test
59 $ hg branch
60 test
61
62 rollback by pretxncommit saves commit message (issue 1635)
33
63
34 echo '% rollback by pretxncommit saves commit message (issue 1635)'
64 $ echo a >> a
35 echo a >> a
65 $ 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'
66 transaction abort!
37 echo '.hg/last-message.txt:'
67 rollback completed
38 cat .hg/last-message.txt ; echo
68 abort: pretxncommit hook exited with status * (glob)
69 [255]
70
71 .hg/last-message.txt:
39
72
40 echo '% same thing, but run $EDITOR'
73 $ cat .hg/last-message.txt ; echo
41 cat > $HGTMP/editor <<'__EOF__'
74 precious commit message
42 #!/bin/sh
75 $ echo '% same thing, but run $EDITOR'
43 echo "another precious commit message" > "$1"
76 % same thing, but run $EDITOR
44 __EOF__
77 $ cat > $HGTMP/editor <<'__EOF__'
45 chmod +x "$HGTMP"/editor
78 > #!/bin/sh
46 HGEDITOR="'$HGTMP'"/editor hg --config hooks.pretxncommit=false commit 2>&1 | sed 's,exited with status .*,exited ...,g'
79 > echo "another precious commit message" > "$1"
47 echo '.hg/last-message.txt:'
80 > __EOF__
48 cat .hg/last-message.txt
81 > chmod +x "$HGTMP"/editor
82 > HGEDITOR="'$HGTMP'"/editor hg --config hooks.pretxncommit=false commit 2>&1
83 > cat .hg/last-message.txt
84 transaction abort!
85 rollback completed
86 note: commit message saved in .hg/last-message.txt
87 abort: pretxncommit hook exited with status * (glob)
88 another precious commit message
89
90 .hg/last-message.txt:
91
1 NO CONTENT: file was removed
NO CONTENT: file was removed
General Comments 0
You need to be logged in to leave comments. Login now