Show More
@@ -1,119 +1,119 b'' | |||||
1 |
|
1 | setup repo | ||
2 |
$ |
|
2 | $ hg init t | |
3 | $ cd t |
|
3 | $ cd t | |
4 | $ echo a > a |
|
4 | $ echo a > a | |
5 |
$ hg |
|
5 | $ hg commit -Am'add a' | |
6 | $ hg commit -m "test" |
|
6 | adding a | |
7 |
$ |
|
7 | $ hg verify | |
8 | checking changesets |
|
8 | checking changesets | |
9 | checking manifests |
|
9 | checking manifests | |
10 | crosschecking files in changesets and manifests |
|
10 | crosschecking files in changesets and manifests | |
11 | checking files |
|
11 | checking files | |
12 | 1 files, 1 changesets, 1 total revisions |
|
12 | 1 files, 1 changesets, 1 total revisions | |
13 | $ hg parents |
|
13 | $ hg parents | |
14 |
changeset: 0: |
|
14 | changeset: 0:1f0dee641bb7 | |
15 | tag: tip |
|
15 | tag: tip | |
16 | user: test |
|
16 | user: test | |
17 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
17 | date: Thu Jan 01 00:00:00 1970 +0000 | |
18 |
summary: |
|
18 | summary: add a | |
19 |
|
19 | |||
|
20 | ||||
|
21 | rollback to null revision | |||
20 |
$ |
|
22 | $ hg status | |
21 | $ hg rollback |
|
23 | $ hg rollback | |
22 | repository tip rolled back to revision -1 (undo commit) |
|
24 | repository tip rolled back to revision -1 (undo commit) | |
23 | working directory now based on revision -1 |
|
25 | working directory now based on revision -1 | |
24 | $ hg verify |
|
26 | $ hg verify | |
25 | checking changesets |
|
27 | checking changesets | |
26 | checking manifests |
|
28 | checking manifests | |
27 | crosschecking files in changesets and manifests |
|
29 | crosschecking files in changesets and manifests | |
28 | checking files |
|
30 | checking files | |
29 | 0 files, 0 changesets, 0 total revisions |
|
31 | 0 files, 0 changesets, 0 total revisions | |
30 | $ hg parents |
|
32 | $ hg parents | |
31 | $ hg status |
|
33 | $ hg status | |
32 | A a |
|
34 | A a | |
33 |
|
35 | |||
34 | Test issue 902 |
|
36 | Two changesets this time so we rollback to a real changeset | |
|
37 | $ hg commit -m'add a again' | |||
|
38 | $ echo a >> a | |||
|
39 | $ hg commit -m'modify a' | |||
35 |
|
40 | |||
36 | $ hg commit -m "test2" |
|
41 | Test issue 902 (current branch is preserved) | |
37 | $ hg branch test |
|
42 | $ hg branch test | |
38 | marked working directory as branch test |
|
43 | marked working directory as branch test | |
39 | $ hg rollback |
|
44 | $ hg rollback | |
40 |
repository tip rolled back to revision |
|
45 | repository tip rolled back to revision 0 (undo commit) | |
41 |
working directory now based on revision |
|
46 | working directory now based on revision 0 | |
42 | $ hg branch |
|
47 | $ hg branch | |
43 | default |
|
48 | default | |
44 |
|
49 | |||
45 | Test issue 1635 (commit message saved) |
|
50 | Test issue 1635 (commit message saved) | |
46 | .hg/last-message.txt: |
|
|||
47 |
|
||||
48 | $ cat .hg/last-message.txt ; echo |
|
51 | $ cat .hg/last-message.txt ; echo | |
49 | test2 |
|
52 | modify a | |
50 |
|
53 | |||
51 | Test rollback of hg before issue 902 was fixed |
|
54 | Test rollback of hg before issue 902 was fixed | |
52 |
|
55 | |||
53 | $ hg commit -m "test3" |
|
56 | $ hg commit -m "test3" | |
54 | $ hg branch test |
|
57 | $ hg branch test | |
55 | marked working directory as branch test |
|
58 | marked working directory as branch test | |
56 | $ rm .hg/undo.branch |
|
59 | $ rm .hg/undo.branch | |
57 | $ hg rollback |
|
60 | $ hg rollback | |
58 |
repository tip rolled back to revision |
|
61 | repository tip rolled back to revision 0 (undo commit) | |
59 | named branch could not be reset, current branch is still: test |
|
62 | named branch could not be reset, current branch is still: test | |
60 |
working directory now based on revision |
|
63 | working directory now based on revision 0 | |
61 | $ hg branch |
|
64 | $ hg branch | |
62 | test |
|
65 | test | |
63 |
|
66 | |||
64 | rollback by pretxncommit saves commit message (issue 1635) |
|
67 | rollback by pretxncommit saves commit message (issue 1635) | |
65 |
|
68 | |||
66 | $ echo a >> a |
|
69 | $ echo a >> a | |
67 | $ hg --config hooks.pretxncommit=false commit -m"precious commit message" |
|
70 | $ hg --config hooks.pretxncommit=false commit -m"precious commit message" | |
68 | transaction abort! |
|
71 | transaction abort! | |
69 | rollback completed |
|
72 | rollback completed | |
70 | abort: pretxncommit hook exited with status * (glob) |
|
73 | abort: pretxncommit hook exited with status * (glob) | |
71 | [255] |
|
74 | [255] | |
72 |
|
||||
73 | .hg/last-message.txt: |
|
|||
74 |
|
||||
75 |
$ |
|
75 | $ cat .hg/last-message.txt ; echo | |
76 | precious commit message |
|
76 | precious commit message | |
77 |
|
77 | |||
78 | same thing, but run $EDITOR |
|
78 | same thing, but run $EDITOR | |
79 |
|
79 | |||
80 | $ cat > editor << '__EOF__' |
|
80 | $ cat > editor << '__EOF__' | |
81 | > #!/bin/sh |
|
81 | > #!/bin/sh | |
82 | > echo "another precious commit message" > "$1" |
|
82 | > echo "another precious commit message" > "$1" | |
83 | > __EOF__ |
|
83 | > __EOF__ | |
84 | $ chmod +x editor |
|
84 | $ chmod +x editor | |
85 | $ HGEDITOR="'`pwd`'"/editor hg --config hooks.pretxncommit=false commit 2>&1 |
|
85 | $ HGEDITOR="'`pwd`'"/editor hg --config hooks.pretxncommit=false commit 2>&1 | |
86 | transaction abort! |
|
86 | transaction abort! | |
87 | rollback completed |
|
87 | rollback completed | |
88 | note: commit message saved in .hg/last-message.txt |
|
88 | note: commit message saved in .hg/last-message.txt | |
89 | abort: pretxncommit hook exited with status * (glob) |
|
89 | abort: pretxncommit hook exited with status * (glob) | |
90 | [255] |
|
90 | [255] | |
91 | $ cat .hg/last-message.txt |
|
91 | $ cat .hg/last-message.txt | |
92 | another precious commit message |
|
92 | another precious commit message | |
93 |
|
93 | |||
94 | test rollback on served repository |
|
94 | test rollback on served repository | |
95 |
|
95 | |||
96 | $ hg commit -m "precious commit message" |
|
96 | $ hg commit -m "precious commit message" | |
97 | $ hg serve -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log |
|
97 | $ hg serve -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log | |
98 | $ cat hg.pid >> $DAEMON_PIDS |
|
98 | $ cat hg.pid >> $DAEMON_PIDS | |
99 | $ cd .. |
|
99 | $ cd .. | |
100 | $ hg clone http://localhost:$HGPORT u |
|
100 | $ hg clone http://localhost:$HGPORT u | |
101 | requesting all changes |
|
101 | requesting all changes | |
102 | adding changesets |
|
102 | adding changesets | |
103 | adding manifests |
|
103 | adding manifests | |
104 | adding file changes |
|
104 | adding file changes | |
105 |
added |
|
105 | added 2 changesets with 2 changes to 1 files | |
106 |
updating to branch |
|
106 | updating to branch default | |
107 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
107 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
108 | $ cd u |
|
108 | $ cd u | |
109 | $ hg id default |
|
109 | $ hg id default | |
110 | 1df294f7b1a2 |
|
110 | 8902593132ae | |
111 |
|
111 | |||
112 | now rollback and observe that 'hg serve' reloads the repository and |
|
112 | now rollback and observe that 'hg serve' reloads the repository and | |
113 | presents the correct tip changeset: |
|
113 | presents the correct tip changeset: | |
114 |
|
114 | |||
115 | $ hg -R ../t rollback |
|
115 | $ hg -R ../t rollback | |
116 |
repository tip rolled back to revision |
|
116 | repository tip rolled back to revision 0 (undo commit) | |
117 |
working directory now based on revision |
|
117 | working directory now based on revision 0 | |
118 | $ hg id default |
|
118 | $ hg id default | |
119 | 000000000000 |
|
119 | 23b0221f3370 |
General Comments 0
You need to be logged in to leave comments.
Login now