Show More
@@ -1,48 +1,91 b'' | |||
|
1 | #!/bin/sh | |
|
2 | 1 | |
|
3 | mkdir t | |
|
4 | cd t | |
|
5 | hg init | |
|
6 | echo a > a | |
|
7 | hg add a | |
|
8 | hg commit -m "test" | |
|
9 | hg verify | |
|
10 | hg parents | |
|
11 | hg status | |
|
12 | hg rollback | |
|
13 | hg verify | |
|
14 | hg parents | |
|
15 | hg status | |
|
2 | $ mkdir t | |
|
3 | $ cd t | |
|
4 | $ hg init | |
|
5 | $ echo a > a | |
|
6 | $ hg add a | |
|
7 | $ hg commit -m "test" | |
|
8 | $ hg verify | |
|
9 | checking changesets | |
|
10 | checking manifests | |
|
11 | crosschecking files in changesets and manifests | |
|
12 | checking files | |
|
13 | 1 files, 1 changesets, 1 total revisions | |
|
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 |
|
|
|
18 | hg commit -m "test2" | |
|
19 | hg branch test | |
|
20 | hg rollback | |
|
21 | hg branch | |
|
34 | Test issue 902 | |
|
35 | ||
|
36 | $ hg commit -m "test2" | |
|
37 | $ hg branch test | |
|
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)' | |
|
24 | echo '.hg/last-message.txt:' | |
|
25 | cat .hg/last-message.txt ; echo | |
|
47 | $ cat .hg/last-message.txt ; echo | |
|
48 | test2 | |
|
49 | ||
|
50 | Test rollback of hg before issue 902 was fixed | |
|
26 | 51 | |
|
27 | echo % Test rollback of hg before issue 902 was fixed | |
|
28 | hg commit -m "test3" | |
|
29 | hg branch test | |
|
30 | rm .hg/undo.branch | |
|
31 | hg rollback | |
|
32 | hg branch | |
|
52 | $ hg commit -m "test3" | |
|
53 | $ hg branch test | |
|
54 | marked working directory as branch test | |
|
55 | $ rm .hg/undo.branch | |
|
56 | $ hg rollback | |
|
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)' | |
|
35 | echo a >> a | |
|
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:' | |
|
38 | cat .hg/last-message.txt ; echo | |
|
64 | $ echo a >> a | |
|
65 | $ hg --config hooks.pretxncommit=false commit -m"precious commit message" | |
|
66 | transaction abort! | |
|
67 | rollback completed | |
|
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' | |
|
41 | cat > $HGTMP/editor <<'__EOF__' | |
|
42 | #!/bin/sh | |
|
43 | echo "another precious commit message" > "$1" | |
|
44 | __EOF__ | |
|
45 | chmod +x "$HGTMP"/editor | |
|
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:' | |
|
48 | cat .hg/last-message.txt | |
|
73 | $ cat .hg/last-message.txt ; echo | |
|
74 | precious commit message | |
|
75 | $ echo '% same thing, but run $EDITOR' | |
|
76 | % same thing, but run $EDITOR | |
|
77 | $ cat > $HGTMP/editor <<'__EOF__' | |
|
78 | > #!/bin/sh | |
|
79 | > echo "another precious commit message" > "$1" | |
|
80 | > __EOF__ | |
|
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 |
General Comments 0
You need to be logged in to leave comments.
Login now