Show More
@@ -1,824 +1,826 b'' | |||||
1 | $ hg init basic |
|
1 | $ hg init basic | |
2 | $ cd basic |
|
2 | $ cd basic | |
3 |
|
3 | |||
4 | should complain |
|
4 | should complain | |
5 |
|
5 | |||
6 | $ hg backout |
|
6 | $ hg backout | |
7 | abort: please specify a revision to backout |
|
7 | abort: please specify a revision to backout | |
8 | [10] |
|
8 | [10] | |
9 | $ hg backout -r 0 0 |
|
9 | $ hg backout -r 0 0 | |
10 | abort: please specify just one revision |
|
10 | abort: please specify just one revision | |
11 | [10] |
|
11 | [10] | |
12 |
|
12 | |||
13 | basic operation |
|
13 | basic operation | |
14 | (this also tests that editor is invoked if the commit message is not |
|
14 | (this also tests that editor is invoked if the commit message is not | |
15 | specified explicitly) |
|
15 | specified explicitly) | |
16 |
|
16 | |||
17 | $ echo a > a |
|
17 | $ echo a > a | |
18 | $ hg commit -d '0 0' -A -m a |
|
18 | $ hg commit -d '0 0' -A -m a | |
19 | adding a |
|
19 | adding a | |
20 | $ echo b >> a |
|
20 | $ echo b >> a | |
21 | $ hg commit -d '1 0' -m b |
|
21 | $ hg commit -d '1 0' -m b | |
22 |
|
22 | |||
23 | $ hg status --rev tip --rev "tip^1" |
|
23 | $ hg status --rev tip --rev "tip^1" | |
24 | M a |
|
24 | M a | |
25 | $ HGEDITOR=cat hg backout -d '2 0' tip --tool=true |
|
25 | $ HGEDITOR=cat hg backout -d '2 0' tip --tool=true | |
26 | reverting a |
|
26 | reverting a | |
27 | Backed out changeset a820f4f40a57 |
|
27 | Backed out changeset a820f4f40a57 | |
28 |
|
28 | |||
29 |
|
29 | |||
30 | HG: Enter commit message. Lines beginning with 'HG:' are removed. |
|
30 | HG: Enter commit message. Lines beginning with 'HG:' are removed. | |
31 | HG: Leave message empty to abort commit. |
|
31 | HG: Leave message empty to abort commit. | |
32 | HG: -- |
|
32 | HG: -- | |
33 | HG: user: test |
|
33 | HG: user: test | |
34 | HG: branch 'default' |
|
34 | HG: branch 'default' | |
35 | HG: changed a |
|
35 | HG: changed a | |
36 | changeset 2:2929462c3dff backs out changeset 1:a820f4f40a57 |
|
36 | changeset 2:2929462c3dff backs out changeset 1:a820f4f40a57 | |
37 | $ cat a |
|
37 | $ cat a | |
38 | a |
|
38 | a | |
39 | $ hg summary |
|
39 | $ hg summary | |
40 | parent: 2:2929462c3dff tip |
|
40 | parent: 2:2929462c3dff tip | |
41 | Backed out changeset a820f4f40a57 |
|
41 | Backed out changeset a820f4f40a57 | |
42 | branch: default |
|
42 | branch: default | |
43 | commit: (clean) |
|
43 | commit: (clean) | |
44 | update: (current) |
|
44 | update: (current) | |
45 | phases: 3 draft |
|
45 | phases: 3 draft | |
46 |
|
46 | |||
47 | commit option |
|
47 | commit option | |
48 |
|
48 | |||
49 | $ cd .. |
|
49 | $ cd .. | |
50 | $ hg init commit |
|
50 | $ hg init commit | |
51 | $ cd commit |
|
51 | $ cd commit | |
52 |
|
52 | |||
53 | $ echo tomatoes > a |
|
53 | $ echo tomatoes > a | |
54 | $ hg add a |
|
54 | $ hg add a | |
55 | $ hg commit -d '0 0' -m tomatoes |
|
55 | $ hg commit -d '0 0' -m tomatoes | |
56 |
|
56 | |||
57 | $ echo chair > b |
|
57 | $ echo chair > b | |
58 | $ hg add b |
|
58 | $ hg add b | |
59 | $ hg commit -d '1 0' -m chair |
|
59 | $ hg commit -d '1 0' -m chair | |
60 |
|
60 | |||
61 | $ echo grapes >> a |
|
61 | $ echo grapes >> a | |
62 | $ hg commit -d '2 0' -m grapes |
|
62 | $ hg commit -d '2 0' -m grapes | |
63 |
|
63 | |||
64 | $ hg backout -d '4 0' 1 --tool=:fail |
|
64 | $ hg backout -d '4 0' 1 --tool=:fail | |
65 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
65 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
66 | changeset 3:1c2161e97c0a backs out changeset 1:22cb4f70d813 |
|
66 | changeset 3:1c2161e97c0a backs out changeset 1:22cb4f70d813 | |
67 | $ hg summary |
|
67 | $ hg summary | |
68 | parent: 3:1c2161e97c0a tip |
|
68 | parent: 3:1c2161e97c0a tip | |
69 | Backed out changeset 22cb4f70d813 |
|
69 | Backed out changeset 22cb4f70d813 | |
70 | branch: default |
|
70 | branch: default | |
71 | commit: (clean) |
|
71 | commit: (clean) | |
72 | update: (current) |
|
72 | update: (current) | |
73 | phases: 4 draft |
|
73 | phases: 4 draft | |
74 |
|
74 | |||
75 | $ echo ypples > a |
|
75 | $ echo ypples > a | |
76 | $ hg commit -d '5 0' -m ypples |
|
76 | $ hg commit -d '5 0' -m ypples | |
77 |
|
77 | |||
78 | $ hg backout -d '6 0' 2 --tool=:fail |
|
78 | $ hg backout -d '6 0' 2 --tool=:fail | |
79 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
79 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved | |
80 | use 'hg resolve' to retry unresolved file merges |
|
80 | use 'hg resolve' to retry unresolved file merges | |
81 | [1] |
|
81 | [1] | |
82 | $ hg summary |
|
82 | $ hg summary | |
83 | parent: 4:ed99997b793d tip |
|
83 | parent: 4:ed99997b793d tip | |
84 | ypples |
|
84 | ypples | |
85 | branch: default |
|
85 | branch: default | |
86 | commit: 1 unresolved (clean) |
|
86 | commit: 1 unresolved (clean) | |
87 | update: (current) |
|
87 | update: (current) | |
88 | phases: 5 draft |
|
88 | phases: 5 draft | |
89 | $ hg log -G |
|
89 | $ hg log -G | |
90 | @ changeset: 4:ed99997b793d |
|
90 | @ changeset: 4:ed99997b793d | |
91 | | tag: tip |
|
91 | | tag: tip | |
92 | | user: test |
|
92 | | user: test | |
93 | | date: Thu Jan 01 00:00:05 1970 +0000 |
|
93 | | date: Thu Jan 01 00:00:05 1970 +0000 | |
94 | | summary: ypples |
|
94 | | summary: ypples | |
95 | | |
|
95 | | | |
96 | o changeset: 3:1c2161e97c0a |
|
96 | o changeset: 3:1c2161e97c0a | |
97 | | user: test |
|
97 | | user: test | |
98 | | date: Thu Jan 01 00:00:04 1970 +0000 |
|
98 | | date: Thu Jan 01 00:00:04 1970 +0000 | |
99 | | summary: Backed out changeset 22cb4f70d813 |
|
99 | | summary: Backed out changeset 22cb4f70d813 | |
100 | | |
|
100 | | | |
101 | o changeset: 2:a8c6e511cfee |
|
101 | o changeset: 2:a8c6e511cfee | |
102 | | user: test |
|
102 | | user: test | |
103 | | date: Thu Jan 01 00:00:02 1970 +0000 |
|
103 | | date: Thu Jan 01 00:00:02 1970 +0000 | |
104 | | summary: grapes |
|
104 | | summary: grapes | |
105 | | |
|
105 | | | |
106 | % changeset: 1:22cb4f70d813 |
|
106 | % changeset: 1:22cb4f70d813 | |
107 | | user: test |
|
107 | | user: test | |
108 | | date: Thu Jan 01 00:00:01 1970 +0000 |
|
108 | | date: Thu Jan 01 00:00:01 1970 +0000 | |
109 | | summary: chair |
|
109 | | summary: chair | |
110 | | |
|
110 | | | |
111 | o changeset: 0:a5cb2dde5805 |
|
111 | o changeset: 0:a5cb2dde5805 | |
112 | user: test |
|
112 | user: test | |
113 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
113 | date: Thu Jan 01 00:00:00 1970 +0000 | |
114 | summary: tomatoes |
|
114 | summary: tomatoes | |
115 |
|
115 | |||
116 |
|
116 | |||
117 | file that was removed is recreated |
|
117 | file that was removed is recreated | |
118 | (this also tests that editor is not invoked if the commit message is |
|
118 | (this also tests that editor is not invoked if the commit message is | |
119 | specified explicitly) |
|
119 | specified explicitly) | |
120 |
|
120 | |||
121 | $ cd .. |
|
121 | $ cd .. | |
122 | $ hg init remove |
|
122 | $ hg init remove | |
123 | $ cd remove |
|
123 | $ cd remove | |
124 |
|
124 | |||
125 | $ echo content > a |
|
125 | $ echo content > a | |
126 | $ hg commit -d '0 0' -A -m a |
|
126 | $ hg commit -d '0 0' -A -m a | |
127 | adding a |
|
127 | adding a | |
128 |
|
128 | |||
129 | $ hg rm a |
|
129 | $ hg rm a | |
130 | $ hg commit -d '1 0' -m b |
|
130 | $ hg commit -d '1 0' -m b | |
131 |
|
131 | |||
132 | $ HGEDITOR=cat hg backout -d '2 0' tip --tool=true -m "Backed out changeset 76862dcce372" |
|
132 | $ HGEDITOR=cat hg backout -d '2 0' tip --tool=true -m "Backed out changeset 76862dcce372" | |
133 | adding a |
|
133 | adding a | |
134 | changeset 2:de31bdc76c0d backs out changeset 1:76862dcce372 |
|
134 | changeset 2:de31bdc76c0d backs out changeset 1:76862dcce372 | |
135 | $ cat a |
|
135 | $ cat a | |
136 | content |
|
136 | content | |
137 | $ hg summary |
|
137 | $ hg summary | |
138 | parent: 2:de31bdc76c0d tip |
|
138 | parent: 2:de31bdc76c0d tip | |
139 | Backed out changeset 76862dcce372 |
|
139 | Backed out changeset 76862dcce372 | |
140 | branch: default |
|
140 | branch: default | |
141 | commit: (clean) |
|
141 | commit: (clean) | |
142 | update: (current) |
|
142 | update: (current) | |
143 | phases: 3 draft |
|
143 | phases: 3 draft | |
144 |
|
144 | |||
145 | backout of backout is as if nothing happened |
|
145 | backout of backout is as if nothing happened | |
146 |
|
146 | |||
147 | $ hg backout -d '3 0' --merge tip --tool=true |
|
147 | $ hg backout -d '3 0' --merge tip --tool=true | |
148 | removing a |
|
148 | removing a | |
149 | changeset 3:7f6d0f120113 backs out changeset 2:de31bdc76c0d |
|
149 | changeset 3:7f6d0f120113 backs out changeset 2:de31bdc76c0d | |
150 | $ test -f a |
|
150 | $ test -f a | |
151 | [1] |
|
151 | [1] | |
152 | $ hg summary |
|
152 | $ hg summary | |
153 | parent: 3:7f6d0f120113 tip |
|
153 | parent: 3:7f6d0f120113 tip | |
154 | Backed out changeset de31bdc76c0d |
|
154 | Backed out changeset de31bdc76c0d | |
155 | branch: default |
|
155 | branch: default | |
156 | commit: (clean) |
|
156 | commit: (clean) | |
157 | update: (current) |
|
157 | update: (current) | |
158 | phases: 4 draft |
|
158 | phases: 4 draft | |
159 |
|
159 | |||
160 | Test that 'hg rollback' restores dirstate just before opening |
|
160 | Test that 'hg rollback' restores dirstate just before opening | |
161 | transaction: in-memory dirstate changes should be written into |
|
161 | transaction: in-memory dirstate changes should be written into | |
162 | '.hg/journal.dirstate' as expected. |
|
162 | '.hg/journal.dirstate' as expected. | |
163 |
|
163 | |||
164 | $ echo 'removed soon' > b |
|
164 | $ echo 'removed soon' > b | |
165 | $ hg commit -A -d '4 0' -m 'prepare for subsequent removing' |
|
165 | $ hg commit -A -d '4 0' -m 'prepare for subsequent removing' | |
166 | adding b |
|
166 | adding b | |
167 | $ echo 'newly added' > c |
|
167 | $ echo 'newly added' > c | |
168 | $ hg add c |
|
168 | $ hg add c | |
169 | $ hg remove b |
|
169 | $ hg remove b | |
170 | $ hg commit -d '5 0' -m 'prepare for subsequent backout' |
|
170 | $ hg commit -d '5 0' -m 'prepare for subsequent backout' | |
171 | $ touch -t 200001010000 c |
|
171 | $ touch -t 200001010000 c | |
172 | $ hg status -A |
|
172 | $ hg status -A | |
173 | C c |
|
173 | C c | |
174 | $ hg debugstate --no-dates |
|
174 | $ hg debugstate --no-dates | |
175 | n 644 12 set c |
|
175 | n 644 12 set c (no-rhg !) | |
|
176 | n 644 12 unset c (?) | |||
|
177 | n 644 12 set c (?) | |||
176 | $ hg backout -d '6 0' -m 'to be rollback-ed soon' -r . |
|
178 | $ hg backout -d '6 0' -m 'to be rollback-ed soon' -r . | |
177 | removing c |
|
179 | removing c | |
178 | adding b |
|
180 | adding b | |
179 | changeset 6:4bfec048029d backs out changeset 5:fac0b729a654 |
|
181 | changeset 6:4bfec048029d backs out changeset 5:fac0b729a654 | |
180 | $ hg rollback -q |
|
182 | $ hg rollback -q | |
181 | $ hg status -A |
|
183 | $ hg status -A | |
182 | A b |
|
184 | A b | |
183 | R c |
|
185 | R c | |
184 | $ hg debugstate --no-dates |
|
186 | $ hg debugstate --no-dates | |
185 | a 0 -1 unset b |
|
187 | a 0 -1 unset b | |
186 | r 0 0 set c |
|
188 | r 0 0 set c | |
187 |
|
189 | |||
188 | across branch |
|
190 | across branch | |
189 |
|
191 | |||
190 | $ cd .. |
|
192 | $ cd .. | |
191 | $ hg init branch |
|
193 | $ hg init branch | |
192 | $ cd branch |
|
194 | $ cd branch | |
193 | $ echo a > a |
|
195 | $ echo a > a | |
194 | $ hg ci -Am0 |
|
196 | $ hg ci -Am0 | |
195 | adding a |
|
197 | adding a | |
196 | $ echo b > b |
|
198 | $ echo b > b | |
197 | $ hg ci -Am1 |
|
199 | $ hg ci -Am1 | |
198 | adding b |
|
200 | adding b | |
199 | $ hg co -C 0 |
|
201 | $ hg co -C 0 | |
200 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
202 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
201 | $ hg summary |
|
203 | $ hg summary | |
202 | parent: 0:f7b1eb17ad24 |
|
204 | parent: 0:f7b1eb17ad24 | |
203 | 0 |
|
205 | 0 | |
204 | branch: default |
|
206 | branch: default | |
205 | commit: (clean) |
|
207 | commit: (clean) | |
206 | update: 1 new changesets (update) |
|
208 | update: 1 new changesets (update) | |
207 | phases: 2 draft |
|
209 | phases: 2 draft | |
208 |
|
210 | |||
209 | should fail |
|
211 | should fail | |
210 |
|
212 | |||
211 | $ hg backout 1 |
|
213 | $ hg backout 1 | |
212 | abort: cannot backout change that is not an ancestor |
|
214 | abort: cannot backout change that is not an ancestor | |
213 | [10] |
|
215 | [10] | |
214 | $ echo c > c |
|
216 | $ echo c > c | |
215 | $ hg ci -Am2 |
|
217 | $ hg ci -Am2 | |
216 | adding c |
|
218 | adding c | |
217 | created new head |
|
219 | created new head | |
218 | $ hg summary |
|
220 | $ hg summary | |
219 | parent: 2:db815d6d32e6 tip |
|
221 | parent: 2:db815d6d32e6 tip | |
220 | 2 |
|
222 | 2 | |
221 | branch: default |
|
223 | branch: default | |
222 | commit: (clean) |
|
224 | commit: (clean) | |
223 | update: 1 new changesets, 2 branch heads (merge) |
|
225 | update: 1 new changesets, 2 branch heads (merge) | |
224 | phases: 3 draft |
|
226 | phases: 3 draft | |
225 |
|
227 | |||
226 | should fail |
|
228 | should fail | |
227 |
|
229 | |||
228 | $ hg backout 1 |
|
230 | $ hg backout 1 | |
229 | abort: cannot backout change that is not an ancestor |
|
231 | abort: cannot backout change that is not an ancestor | |
230 | [10] |
|
232 | [10] | |
231 | $ hg summary |
|
233 | $ hg summary | |
232 | parent: 2:db815d6d32e6 tip |
|
234 | parent: 2:db815d6d32e6 tip | |
233 | 2 |
|
235 | 2 | |
234 | branch: default |
|
236 | branch: default | |
235 | commit: (clean) |
|
237 | commit: (clean) | |
236 | update: 1 new changesets, 2 branch heads (merge) |
|
238 | update: 1 new changesets, 2 branch heads (merge) | |
237 | phases: 3 draft |
|
239 | phases: 3 draft | |
238 |
|
240 | |||
239 | backout with merge |
|
241 | backout with merge | |
240 |
|
242 | |||
241 | $ cd .. |
|
243 | $ cd .. | |
242 | $ hg init merge |
|
244 | $ hg init merge | |
243 | $ cd merge |
|
245 | $ cd merge | |
244 |
|
246 | |||
245 | $ echo line 1 > a |
|
247 | $ echo line 1 > a | |
246 | $ echo line 2 >> a |
|
248 | $ echo line 2 >> a | |
247 | $ hg commit -d '0 0' -A -m a |
|
249 | $ hg commit -d '0 0' -A -m a | |
248 | adding a |
|
250 | adding a | |
249 | $ hg summary |
|
251 | $ hg summary | |
250 | parent: 0:59395513a13a tip |
|
252 | parent: 0:59395513a13a tip | |
251 | a |
|
253 | a | |
252 | branch: default |
|
254 | branch: default | |
253 | commit: (clean) |
|
255 | commit: (clean) | |
254 | update: (current) |
|
256 | update: (current) | |
255 | phases: 1 draft |
|
257 | phases: 1 draft | |
256 |
|
258 | |||
257 | remove line 1 |
|
259 | remove line 1 | |
258 |
|
260 | |||
259 | $ echo line 2 > a |
|
261 | $ echo line 2 > a | |
260 | $ hg commit -d '1 0' -m b |
|
262 | $ hg commit -d '1 0' -m b | |
261 |
|
263 | |||
262 | $ echo line 3 >> a |
|
264 | $ echo line 3 >> a | |
263 | $ hg commit -d '2 0' -m c |
|
265 | $ hg commit -d '2 0' -m c | |
264 |
|
266 | |||
265 | $ hg backout --merge -d '3 0' 1 --tool=true |
|
267 | $ hg backout --merge -d '3 0' 1 --tool=true | |
266 | reverting a |
|
268 | reverting a | |
267 | created new head |
|
269 | created new head | |
268 | changeset 3:26b8ccb9ad91 backs out changeset 1:5a50a024c182 |
|
270 | changeset 3:26b8ccb9ad91 backs out changeset 1:5a50a024c182 | |
269 | merging with changeset 3:26b8ccb9ad91 |
|
271 | merging with changeset 3:26b8ccb9ad91 | |
270 | merging a |
|
272 | merging a | |
271 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
273 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved | |
272 | (branch merge, don't forget to commit) |
|
274 | (branch merge, don't forget to commit) | |
273 | $ hg commit -d '4 0' -m d |
|
275 | $ hg commit -d '4 0' -m d | |
274 | $ hg summary |
|
276 | $ hg summary | |
275 | parent: 4:c7df5e0b9c09 tip |
|
277 | parent: 4:c7df5e0b9c09 tip | |
276 | d |
|
278 | d | |
277 | branch: default |
|
279 | branch: default | |
278 | commit: (clean) |
|
280 | commit: (clean) | |
279 | update: (current) |
|
281 | update: (current) | |
280 | phases: 5 draft |
|
282 | phases: 5 draft | |
281 |
|
283 | |||
282 | check line 1 is back |
|
284 | check line 1 is back | |
283 |
|
285 | |||
284 | $ cat a |
|
286 | $ cat a | |
285 | line 1 |
|
287 | line 1 | |
286 | line 2 |
|
288 | line 2 | |
287 | line 3 |
|
289 | line 3 | |
288 |
|
290 | |||
289 | Test visibility of in-memory dirstate changes outside transaction to |
|
291 | Test visibility of in-memory dirstate changes outside transaction to | |
290 | external hook process |
|
292 | external hook process | |
291 |
|
293 | |||
292 | $ cat > $TESTTMP/checkvisibility.sh <<EOF |
|
294 | $ cat > $TESTTMP/checkvisibility.sh <<EOF | |
293 | > echo "==== \$1:" |
|
295 | > echo "==== \$1:" | |
294 | > hg parents --template "{rev}:{node|short}\n" |
|
296 | > hg parents --template "{rev}:{node|short}\n" | |
295 | > echo "====" |
|
297 | > echo "====" | |
296 | > EOF |
|
298 | > EOF | |
297 |
|
299 | |||
298 | "hg backout --merge REV1" at REV2 below implies steps below: |
|
300 | "hg backout --merge REV1" at REV2 below implies steps below: | |
299 |
|
301 | |||
300 | (1) update to REV1 (REV2 => REV1) |
|
302 | (1) update to REV1 (REV2 => REV1) | |
301 | (2) revert by REV1^1 |
|
303 | (2) revert by REV1^1 | |
302 | (3) commit backing out revision (REV3) |
|
304 | (3) commit backing out revision (REV3) | |
303 | (4) update to REV2 (REV3 => REV2) |
|
305 | (4) update to REV2 (REV3 => REV2) | |
304 | (5) merge with REV3 (REV2 => REV2, REV3) |
|
306 | (5) merge with REV3 (REV2 => REV2, REV3) | |
305 |
|
307 | |||
306 | == test visibility to external preupdate hook |
|
308 | == test visibility to external preupdate hook | |
307 |
|
309 | |||
308 | $ hg update -q -C 2 |
|
310 | $ hg update -q -C 2 | |
309 | $ hg --config extensions.strip= strip 3 |
|
311 | $ hg --config extensions.strip= strip 3 | |
310 | saved backup bundle to * (glob) |
|
312 | saved backup bundle to * (glob) | |
311 |
|
313 | |||
312 | $ cat >> .hg/hgrc <<EOF |
|
314 | $ cat >> .hg/hgrc <<EOF | |
313 | > [hooks] |
|
315 | > [hooks] | |
314 | > preupdate.visibility = sh $TESTTMP/checkvisibility.sh preupdate |
|
316 | > preupdate.visibility = sh $TESTTMP/checkvisibility.sh preupdate | |
315 | > EOF |
|
317 | > EOF | |
316 |
|
318 | |||
317 | ("-m" is needed to avoid writing dirstate changes out at other than |
|
319 | ("-m" is needed to avoid writing dirstate changes out at other than | |
318 | invocation of the hook to be examined) |
|
320 | invocation of the hook to be examined) | |
319 |
|
321 | |||
320 | $ hg backout --merge -d '3 0' 1 --tool=true -m 'fixed comment' |
|
322 | $ hg backout --merge -d '3 0' 1 --tool=true -m 'fixed comment' | |
321 | ==== preupdate: |
|
323 | ==== preupdate: | |
322 | 2:6ea3f2a197a2 |
|
324 | 2:6ea3f2a197a2 | |
323 | ==== |
|
325 | ==== | |
324 | reverting a |
|
326 | reverting a | |
325 | created new head |
|
327 | created new head | |
326 | changeset 3:d92a3f57f067 backs out changeset 1:5a50a024c182 |
|
328 | changeset 3:d92a3f57f067 backs out changeset 1:5a50a024c182 | |
327 | ==== preupdate: |
|
329 | ==== preupdate: | |
328 | 3:d92a3f57f067 |
|
330 | 3:d92a3f57f067 | |
329 | ==== |
|
331 | ==== | |
330 | merging with changeset 3:d92a3f57f067 |
|
332 | merging with changeset 3:d92a3f57f067 | |
331 | ==== preupdate: |
|
333 | ==== preupdate: | |
332 | 2:6ea3f2a197a2 |
|
334 | 2:6ea3f2a197a2 | |
333 | ==== |
|
335 | ==== | |
334 | merging a |
|
336 | merging a | |
335 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
337 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved | |
336 | (branch merge, don't forget to commit) |
|
338 | (branch merge, don't forget to commit) | |
337 |
|
339 | |||
338 | $ cat >> .hg/hgrc <<EOF |
|
340 | $ cat >> .hg/hgrc <<EOF | |
339 | > [hooks] |
|
341 | > [hooks] | |
340 | > preupdate.visibility = |
|
342 | > preupdate.visibility = | |
341 | > EOF |
|
343 | > EOF | |
342 |
|
344 | |||
343 | == test visibility to external update hook |
|
345 | == test visibility to external update hook | |
344 |
|
346 | |||
345 | $ hg update -q -C 2 |
|
347 | $ hg update -q -C 2 | |
346 | $ hg --config extensions.strip= strip 3 |
|
348 | $ hg --config extensions.strip= strip 3 | |
347 | saved backup bundle to * (glob) |
|
349 | saved backup bundle to * (glob) | |
348 |
|
350 | |||
349 | $ cat >> .hg/hgrc <<EOF |
|
351 | $ cat >> .hg/hgrc <<EOF | |
350 | > [hooks] |
|
352 | > [hooks] | |
351 | > update.visibility = sh $TESTTMP/checkvisibility.sh update |
|
353 | > update.visibility = sh $TESTTMP/checkvisibility.sh update | |
352 | > EOF |
|
354 | > EOF | |
353 |
|
355 | |||
354 | $ hg backout --merge -d '3 0' 1 --tool=true -m 'fixed comment' |
|
356 | $ hg backout --merge -d '3 0' 1 --tool=true -m 'fixed comment' | |
355 | ==== update: |
|
357 | ==== update: | |
356 | 1:5a50a024c182 |
|
358 | 1:5a50a024c182 | |
357 | ==== |
|
359 | ==== | |
358 | reverting a |
|
360 | reverting a | |
359 | created new head |
|
361 | created new head | |
360 | changeset 3:d92a3f57f067 backs out changeset 1:5a50a024c182 |
|
362 | changeset 3:d92a3f57f067 backs out changeset 1:5a50a024c182 | |
361 | ==== update: |
|
363 | ==== update: | |
362 | 2:6ea3f2a197a2 |
|
364 | 2:6ea3f2a197a2 | |
363 | ==== |
|
365 | ==== | |
364 | merging with changeset 3:d92a3f57f067 |
|
366 | merging with changeset 3:d92a3f57f067 | |
365 | merging a |
|
367 | merging a | |
366 | ==== update: |
|
368 | ==== update: | |
367 | 2:6ea3f2a197a2 |
|
369 | 2:6ea3f2a197a2 | |
368 | 3:d92a3f57f067 |
|
370 | 3:d92a3f57f067 | |
369 | ==== |
|
371 | ==== | |
370 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
372 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved | |
371 | (branch merge, don't forget to commit) |
|
373 | (branch merge, don't forget to commit) | |
372 |
|
374 | |||
373 | $ cat >> .hg/hgrc <<EOF |
|
375 | $ cat >> .hg/hgrc <<EOF | |
374 | > [hooks] |
|
376 | > [hooks] | |
375 | > update.visibility = |
|
377 | > update.visibility = | |
376 | > EOF |
|
378 | > EOF | |
377 |
|
379 | |||
378 | $ cd .. |
|
380 | $ cd .. | |
379 |
|
381 | |||
380 | backout should not back out subsequent changesets |
|
382 | backout should not back out subsequent changesets | |
381 |
|
383 | |||
382 | $ hg init onecs |
|
384 | $ hg init onecs | |
383 | $ cd onecs |
|
385 | $ cd onecs | |
384 | $ echo 1 > a |
|
386 | $ echo 1 > a | |
385 | $ hg commit -d '0 0' -A -m a |
|
387 | $ hg commit -d '0 0' -A -m a | |
386 | adding a |
|
388 | adding a | |
387 | $ echo 2 >> a |
|
389 | $ echo 2 >> a | |
388 | $ hg commit -d '1 0' -m b |
|
390 | $ hg commit -d '1 0' -m b | |
389 | $ echo 1 > b |
|
391 | $ echo 1 > b | |
390 | $ hg commit -d '2 0' -A -m c |
|
392 | $ hg commit -d '2 0' -A -m c | |
391 | adding b |
|
393 | adding b | |
392 | $ hg summary |
|
394 | $ hg summary | |
393 | parent: 2:882396649954 tip |
|
395 | parent: 2:882396649954 tip | |
394 | c |
|
396 | c | |
395 | branch: default |
|
397 | branch: default | |
396 | commit: (clean) |
|
398 | commit: (clean) | |
397 | update: (current) |
|
399 | update: (current) | |
398 | phases: 3 draft |
|
400 | phases: 3 draft | |
399 |
|
401 | |||
400 | without --merge |
|
402 | without --merge | |
401 | $ hg backout --no-commit -d '3 0' 1 --tool=true |
|
403 | $ hg backout --no-commit -d '3 0' 1 --tool=true | |
402 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
404 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
403 | changeset 22bca4c721e5 backed out, don't forget to commit. |
|
405 | changeset 22bca4c721e5 backed out, don't forget to commit. | |
404 | $ hg locate b |
|
406 | $ hg locate b | |
405 | b |
|
407 | b | |
406 | $ hg update -C tip |
|
408 | $ hg update -C tip | |
407 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
409 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
408 | $ hg locate b |
|
410 | $ hg locate b | |
409 | b |
|
411 | b | |
410 | $ hg summary |
|
412 | $ hg summary | |
411 | parent: 2:882396649954 tip |
|
413 | parent: 2:882396649954 tip | |
412 | c |
|
414 | c | |
413 | branch: default |
|
415 | branch: default | |
414 | commit: (clean) |
|
416 | commit: (clean) | |
415 | update: (current) |
|
417 | update: (current) | |
416 | phases: 3 draft |
|
418 | phases: 3 draft | |
417 |
|
419 | |||
418 | with --merge |
|
420 | with --merge | |
419 | $ hg backout --merge -d '3 0' 1 --tool=true |
|
421 | $ hg backout --merge -d '3 0' 1 --tool=true | |
420 | reverting a |
|
422 | reverting a | |
421 | created new head |
|
423 | created new head | |
422 | changeset 3:3202beb76721 backs out changeset 1:22bca4c721e5 |
|
424 | changeset 3:3202beb76721 backs out changeset 1:22bca4c721e5 | |
423 | merging with changeset 3:3202beb76721 |
|
425 | merging with changeset 3:3202beb76721 | |
424 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
426 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
425 | (branch merge, don't forget to commit) |
|
427 | (branch merge, don't forget to commit) | |
426 | $ hg locate b |
|
428 | $ hg locate b | |
427 | b |
|
429 | b | |
428 | $ hg update -C tip |
|
430 | $ hg update -C tip | |
429 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
431 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
430 | $ hg locate b |
|
432 | $ hg locate b | |
431 | [1] |
|
433 | [1] | |
432 |
|
434 | |||
433 | $ cd .. |
|
435 | $ cd .. | |
434 | $ hg init m |
|
436 | $ hg init m | |
435 | $ cd m |
|
437 | $ cd m | |
436 | $ echo a > a |
|
438 | $ echo a > a | |
437 | $ hg commit -d '0 0' -A -m a |
|
439 | $ hg commit -d '0 0' -A -m a | |
438 | adding a |
|
440 | adding a | |
439 | $ echo b > b |
|
441 | $ echo b > b | |
440 | $ hg commit -d '1 0' -A -m b |
|
442 | $ hg commit -d '1 0' -A -m b | |
441 | adding b |
|
443 | adding b | |
442 | $ echo c > c |
|
444 | $ echo c > c | |
443 | $ hg commit -d '2 0' -A -m b |
|
445 | $ hg commit -d '2 0' -A -m b | |
444 | adding c |
|
446 | adding c | |
445 | $ hg update 1 |
|
447 | $ hg update 1 | |
446 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
448 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
447 | $ echo d > d |
|
449 | $ echo d > d | |
448 | $ hg commit -d '3 0' -A -m c |
|
450 | $ hg commit -d '3 0' -A -m c | |
449 | adding d |
|
451 | adding d | |
450 | created new head |
|
452 | created new head | |
451 | $ hg merge 2 |
|
453 | $ hg merge 2 | |
452 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
454 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
453 | (branch merge, don't forget to commit) |
|
455 | (branch merge, don't forget to commit) | |
454 | $ hg commit -d '4 0' -A -m d |
|
456 | $ hg commit -d '4 0' -A -m d | |
455 | $ hg summary |
|
457 | $ hg summary | |
456 | parent: 4:b2f3bb92043e tip |
|
458 | parent: 4:b2f3bb92043e tip | |
457 | d |
|
459 | d | |
458 | branch: default |
|
460 | branch: default | |
459 | commit: (clean) |
|
461 | commit: (clean) | |
460 | update: (current) |
|
462 | update: (current) | |
461 | phases: 5 draft |
|
463 | phases: 5 draft | |
462 |
|
464 | |||
463 | backout of merge should fail |
|
465 | backout of merge should fail | |
464 |
|
466 | |||
465 | $ hg backout 4 |
|
467 | $ hg backout 4 | |
466 | abort: cannot backout a merge changeset |
|
468 | abort: cannot backout a merge changeset | |
467 | [10] |
|
469 | [10] | |
468 |
|
470 | |||
469 | backout of merge with bad parent should fail |
|
471 | backout of merge with bad parent should fail | |
470 |
|
472 | |||
471 | $ hg backout --parent 0 4 |
|
473 | $ hg backout --parent 0 4 | |
472 | abort: cb9a9f314b8b is not a parent of b2f3bb92043e |
|
474 | abort: cb9a9f314b8b is not a parent of b2f3bb92043e | |
473 | [10] |
|
475 | [10] | |
474 |
|
476 | |||
475 | backout of non-merge with parent should fail |
|
477 | backout of non-merge with parent should fail | |
476 |
|
478 | |||
477 | $ hg backout --parent 0 3 |
|
479 | $ hg backout --parent 0 3 | |
478 | abort: cannot use --parent on non-merge changeset |
|
480 | abort: cannot use --parent on non-merge changeset | |
479 | [10] |
|
481 | [10] | |
480 |
|
482 | |||
481 | backout with valid parent should be ok |
|
483 | backout with valid parent should be ok | |
482 |
|
484 | |||
483 | $ hg backout -d '5 0' --parent 2 4 --tool=true |
|
485 | $ hg backout -d '5 0' --parent 2 4 --tool=true | |
484 | removing d |
|
486 | removing d | |
485 | changeset 5:10e5328c8435 backs out changeset 4:b2f3bb92043e |
|
487 | changeset 5:10e5328c8435 backs out changeset 4:b2f3bb92043e | |
486 | $ hg summary |
|
488 | $ hg summary | |
487 | parent: 5:10e5328c8435 tip |
|
489 | parent: 5:10e5328c8435 tip | |
488 | Backed out changeset b2f3bb92043e |
|
490 | Backed out changeset b2f3bb92043e | |
489 | branch: default |
|
491 | branch: default | |
490 | commit: (clean) |
|
492 | commit: (clean) | |
491 | update: (current) |
|
493 | update: (current) | |
492 | phases: 6 draft |
|
494 | phases: 6 draft | |
493 |
|
495 | |||
494 | $ hg rollback |
|
496 | $ hg rollback | |
495 | repository tip rolled back to revision 4 (undo commit) |
|
497 | repository tip rolled back to revision 4 (undo commit) | |
496 | working directory now based on revision 4 |
|
498 | working directory now based on revision 4 | |
497 | $ hg update -C |
|
499 | $ hg update -C | |
498 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
500 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
499 | $ hg summary |
|
501 | $ hg summary | |
500 | parent: 4:b2f3bb92043e tip |
|
502 | parent: 4:b2f3bb92043e tip | |
501 | d |
|
503 | d | |
502 | branch: default |
|
504 | branch: default | |
503 | commit: (clean) |
|
505 | commit: (clean) | |
504 | update: (current) |
|
506 | update: (current) | |
505 | phases: 5 draft |
|
507 | phases: 5 draft | |
506 |
|
508 | |||
507 | $ hg backout -d '6 0' --parent 3 4 --tool=true |
|
509 | $ hg backout -d '6 0' --parent 3 4 --tool=true | |
508 | removing c |
|
510 | removing c | |
509 | changeset 5:033590168430 backs out changeset 4:b2f3bb92043e |
|
511 | changeset 5:033590168430 backs out changeset 4:b2f3bb92043e | |
510 | $ hg summary |
|
512 | $ hg summary | |
511 | parent: 5:033590168430 tip |
|
513 | parent: 5:033590168430 tip | |
512 | Backed out changeset b2f3bb92043e |
|
514 | Backed out changeset b2f3bb92043e | |
513 | branch: default |
|
515 | branch: default | |
514 | commit: (clean) |
|
516 | commit: (clean) | |
515 | update: (current) |
|
517 | update: (current) | |
516 | phases: 6 draft |
|
518 | phases: 6 draft | |
517 |
|
519 | |||
518 | $ cd .. |
|
520 | $ cd .. | |
519 |
|
521 | |||
520 | named branches |
|
522 | named branches | |
521 |
|
523 | |||
522 | $ hg init named_branches |
|
524 | $ hg init named_branches | |
523 | $ cd named_branches |
|
525 | $ cd named_branches | |
524 |
|
526 | |||
525 | $ echo default > default |
|
527 | $ echo default > default | |
526 | $ hg ci -d '0 0' -Am default |
|
528 | $ hg ci -d '0 0' -Am default | |
527 | adding default |
|
529 | adding default | |
528 | $ hg branch branch1 |
|
530 | $ hg branch branch1 | |
529 | marked working directory as branch branch1 |
|
531 | marked working directory as branch branch1 | |
530 | (branches are permanent and global, did you want a bookmark?) |
|
532 | (branches are permanent and global, did you want a bookmark?) | |
531 | $ echo branch1 > file1 |
|
533 | $ echo branch1 > file1 | |
532 | $ hg ci -d '1 0' -Am file1 |
|
534 | $ hg ci -d '1 0' -Am file1 | |
533 | adding file1 |
|
535 | adding file1 | |
534 | $ hg branch branch2 |
|
536 | $ hg branch branch2 | |
535 | marked working directory as branch branch2 |
|
537 | marked working directory as branch branch2 | |
536 | $ echo branch2 > file2 |
|
538 | $ echo branch2 > file2 | |
537 | $ hg ci -d '2 0' -Am file2 |
|
539 | $ hg ci -d '2 0' -Am file2 | |
538 | adding file2 |
|
540 | adding file2 | |
539 |
|
541 | |||
540 | without --merge |
|
542 | without --merge | |
541 | $ hg backout --no-commit -r 1 --tool=true |
|
543 | $ hg backout --no-commit -r 1 --tool=true | |
542 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
544 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
543 | changeset bf1602f437f3 backed out, don't forget to commit. |
|
545 | changeset bf1602f437f3 backed out, don't forget to commit. | |
544 | $ hg branch |
|
546 | $ hg branch | |
545 | branch2 |
|
547 | branch2 | |
546 | $ hg status -A |
|
548 | $ hg status -A | |
547 | R file1 |
|
549 | R file1 | |
548 | C default |
|
550 | C default | |
549 | C file2 |
|
551 | C file2 | |
550 | $ hg summary |
|
552 | $ hg summary | |
551 | parent: 2:45bbcd363bf0 tip |
|
553 | parent: 2:45bbcd363bf0 tip | |
552 | file2 |
|
554 | file2 | |
553 | branch: branch2 |
|
555 | branch: branch2 | |
554 | commit: 1 removed |
|
556 | commit: 1 removed | |
555 | update: (current) |
|
557 | update: (current) | |
556 | phases: 3 draft |
|
558 | phases: 3 draft | |
557 |
|
559 | |||
558 | with --merge |
|
560 | with --merge | |
559 | (this also tests that editor is invoked if '--edit' is specified |
|
561 | (this also tests that editor is invoked if '--edit' is specified | |
560 | explicitly regardless of '--message') |
|
562 | explicitly regardless of '--message') | |
561 |
|
563 | |||
562 | $ hg update -qC |
|
564 | $ hg update -qC | |
563 | $ HGEDITOR=cat hg backout --merge -d '3 0' -r 1 -m 'backout on branch1' --tool=true --edit |
|
565 | $ HGEDITOR=cat hg backout --merge -d '3 0' -r 1 -m 'backout on branch1' --tool=true --edit | |
564 | removing file1 |
|
566 | removing file1 | |
565 | backout on branch1 |
|
567 | backout on branch1 | |
566 |
|
568 | |||
567 |
|
569 | |||
568 | HG: Enter commit message. Lines beginning with 'HG:' are removed. |
|
570 | HG: Enter commit message. Lines beginning with 'HG:' are removed. | |
569 | HG: Leave message empty to abort commit. |
|
571 | HG: Leave message empty to abort commit. | |
570 | HG: -- |
|
572 | HG: -- | |
571 | HG: user: test |
|
573 | HG: user: test | |
572 | HG: branch 'branch2' |
|
574 | HG: branch 'branch2' | |
573 | HG: removed file1 |
|
575 | HG: removed file1 | |
574 | created new head |
|
576 | created new head | |
575 | changeset 3:d4e8f6db59fb backs out changeset 1:bf1602f437f3 |
|
577 | changeset 3:d4e8f6db59fb backs out changeset 1:bf1602f437f3 | |
576 | merging with changeset 3:d4e8f6db59fb |
|
578 | merging with changeset 3:d4e8f6db59fb | |
577 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
579 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
578 | (branch merge, don't forget to commit) |
|
580 | (branch merge, don't forget to commit) | |
579 | $ hg summary |
|
581 | $ hg summary | |
580 | parent: 2:45bbcd363bf0 |
|
582 | parent: 2:45bbcd363bf0 | |
581 | file2 |
|
583 | file2 | |
582 | parent: 3:d4e8f6db59fb tip |
|
584 | parent: 3:d4e8f6db59fb tip | |
583 | backout on branch1 |
|
585 | backout on branch1 | |
584 | branch: branch2 |
|
586 | branch: branch2 | |
585 | commit: 1 removed (merge) |
|
587 | commit: 1 removed (merge) | |
586 | update: (current) |
|
588 | update: (current) | |
587 | phases: 4 draft |
|
589 | phases: 4 draft | |
588 | $ hg update -q -C 2 |
|
590 | $ hg update -q -C 2 | |
589 |
|
591 | |||
590 | on branch2 with branch1 not merged, so file1 should still exist: |
|
592 | on branch2 with branch1 not merged, so file1 should still exist: | |
591 |
|
593 | |||
592 | $ hg id |
|
594 | $ hg id | |
593 | 45bbcd363bf0 (branch2) |
|
595 | 45bbcd363bf0 (branch2) | |
594 | $ hg st -A |
|
596 | $ hg st -A | |
595 | C default |
|
597 | C default | |
596 | C file1 |
|
598 | C file1 | |
597 | C file2 |
|
599 | C file2 | |
598 | $ hg summary |
|
600 | $ hg summary | |
599 | parent: 2:45bbcd363bf0 |
|
601 | parent: 2:45bbcd363bf0 | |
600 | file2 |
|
602 | file2 | |
601 | branch: branch2 |
|
603 | branch: branch2 | |
602 | commit: (clean) |
|
604 | commit: (clean) | |
603 | update: 1 new changesets, 2 branch heads (merge) |
|
605 | update: 1 new changesets, 2 branch heads (merge) | |
604 | phases: 4 draft |
|
606 | phases: 4 draft | |
605 |
|
607 | |||
606 | on branch2 with branch1 merged, so file1 should be gone: |
|
608 | on branch2 with branch1 merged, so file1 should be gone: | |
607 |
|
609 | |||
608 | $ hg merge |
|
610 | $ hg merge | |
609 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
611 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
610 | (branch merge, don't forget to commit) |
|
612 | (branch merge, don't forget to commit) | |
611 | $ hg ci -d '4 0' -m 'merge backout of branch1' |
|
613 | $ hg ci -d '4 0' -m 'merge backout of branch1' | |
612 | $ hg id |
|
614 | $ hg id | |
613 | d97a8500a969 (branch2) tip |
|
615 | d97a8500a969 (branch2) tip | |
614 | $ hg st -A |
|
616 | $ hg st -A | |
615 | C default |
|
617 | C default | |
616 | C file2 |
|
618 | C file2 | |
617 | $ hg summary |
|
619 | $ hg summary | |
618 | parent: 4:d97a8500a969 tip |
|
620 | parent: 4:d97a8500a969 tip | |
619 | merge backout of branch1 |
|
621 | merge backout of branch1 | |
620 | branch: branch2 |
|
622 | branch: branch2 | |
621 | commit: (clean) |
|
623 | commit: (clean) | |
622 | update: (current) |
|
624 | update: (current) | |
623 | phases: 5 draft |
|
625 | phases: 5 draft | |
624 |
|
626 | |||
625 | on branch1, so no file1 and file2: |
|
627 | on branch1, so no file1 and file2: | |
626 |
|
628 | |||
627 | $ hg co -C branch1 |
|
629 | $ hg co -C branch1 | |
628 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
630 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
629 | $ hg id |
|
631 | $ hg id | |
630 | bf1602f437f3 (branch1) |
|
632 | bf1602f437f3 (branch1) | |
631 | $ hg st -A |
|
633 | $ hg st -A | |
632 | C default |
|
634 | C default | |
633 | C file1 |
|
635 | C file1 | |
634 | $ hg summary |
|
636 | $ hg summary | |
635 | parent: 1:bf1602f437f3 |
|
637 | parent: 1:bf1602f437f3 | |
636 | file1 |
|
638 | file1 | |
637 | branch: branch1 |
|
639 | branch: branch1 | |
638 | commit: (clean) |
|
640 | commit: (clean) | |
639 | update: (current) |
|
641 | update: (current) | |
640 | phases: 5 draft |
|
642 | phases: 5 draft | |
641 |
|
643 | |||
642 | $ cd .. |
|
644 | $ cd .. | |
643 |
|
645 | |||
644 | backout of empty changeset (issue4190) |
|
646 | backout of empty changeset (issue4190) | |
645 |
|
647 | |||
646 | $ hg init emptycommit |
|
648 | $ hg init emptycommit | |
647 | $ cd emptycommit |
|
649 | $ cd emptycommit | |
648 |
|
650 | |||
649 | $ touch file1 |
|
651 | $ touch file1 | |
650 | $ hg ci -Aqm file1 |
|
652 | $ hg ci -Aqm file1 | |
651 | $ hg branch -q branch1 |
|
653 | $ hg branch -q branch1 | |
652 | $ hg ci -qm branch1 |
|
654 | $ hg ci -qm branch1 | |
653 | $ hg backout -v 1 |
|
655 | $ hg backout -v 1 | |
654 | resolving manifests |
|
656 | resolving manifests | |
655 | nothing changed |
|
657 | nothing changed | |
656 | [1] |
|
658 | [1] | |
657 |
|
659 | |||
658 | $ cd .. |
|
660 | $ cd .. | |
659 |
|
661 | |||
660 |
|
662 | |||
661 | Test usage of `hg resolve` in case of conflict |
|
663 | Test usage of `hg resolve` in case of conflict | |
662 | (issue4163) |
|
664 | (issue4163) | |
663 |
|
665 | |||
664 | $ hg init issue4163 |
|
666 | $ hg init issue4163 | |
665 | $ cd issue4163 |
|
667 | $ cd issue4163 | |
666 | $ touch foo |
|
668 | $ touch foo | |
667 | $ hg add foo |
|
669 | $ hg add foo | |
668 | $ cat > foo << EOF |
|
670 | $ cat > foo << EOF | |
669 | > one |
|
671 | > one | |
670 | > two |
|
672 | > two | |
671 | > three |
|
673 | > three | |
672 | > four |
|
674 | > four | |
673 | > five |
|
675 | > five | |
674 | > six |
|
676 | > six | |
675 | > seven |
|
677 | > seven | |
676 | > height |
|
678 | > height | |
677 | > nine |
|
679 | > nine | |
678 | > ten |
|
680 | > ten | |
679 | > EOF |
|
681 | > EOF | |
680 | $ hg ci -m 'initial' |
|
682 | $ hg ci -m 'initial' | |
681 | $ cat > foo << EOF |
|
683 | $ cat > foo << EOF | |
682 | > one |
|
684 | > one | |
683 | > two |
|
685 | > two | |
684 | > THREE |
|
686 | > THREE | |
685 | > four |
|
687 | > four | |
686 | > five |
|
688 | > five | |
687 | > six |
|
689 | > six | |
688 | > seven |
|
690 | > seven | |
689 | > height |
|
691 | > height | |
690 | > nine |
|
692 | > nine | |
691 | > ten |
|
693 | > ten | |
692 | > EOF |
|
694 | > EOF | |
693 | $ hg ci -m 'capital three' |
|
695 | $ hg ci -m 'capital three' | |
694 | $ cat > foo << EOF |
|
696 | $ cat > foo << EOF | |
695 | > one |
|
697 | > one | |
696 | > two |
|
698 | > two | |
697 | > THREE |
|
699 | > THREE | |
698 | > four |
|
700 | > four | |
699 | > five |
|
701 | > five | |
700 | > six |
|
702 | > six | |
701 | > seven |
|
703 | > seven | |
702 | > height |
|
704 | > height | |
703 | > nine |
|
705 | > nine | |
704 | > TEN |
|
706 | > TEN | |
705 | > EOF |
|
707 | > EOF | |
706 | $ hg ci -m 'capital ten' |
|
708 | $ hg ci -m 'capital ten' | |
707 | $ hg backout -r 'desc("capital three")' --tool internal:fail |
|
709 | $ hg backout -r 'desc("capital three")' --tool internal:fail | |
708 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
710 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved | |
709 | use 'hg resolve' to retry unresolved file merges |
|
711 | use 'hg resolve' to retry unresolved file merges | |
710 | [1] |
|
712 | [1] | |
711 | $ hg status |
|
713 | $ hg status | |
712 | $ hg debugmergestate -v |
|
714 | $ hg debugmergestate -v | |
713 | v1 and v2 states match: using v2 |
|
715 | v1 and v2 states match: using v2 | |
714 | local: b71750c4b0fdf719734971e3ef90dbeab5919a2d |
|
716 | local: b71750c4b0fdf719734971e3ef90dbeab5919a2d | |
715 | other: a30dd8addae3ce71b8667868478542bc417439e6 |
|
717 | other: a30dd8addae3ce71b8667868478542bc417439e6 | |
716 | file: foo (state "u") |
|
718 | file: foo (state "u") | |
717 | local path: foo (hash 0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33, flags "") |
|
719 | local path: foo (hash 0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33, flags "") | |
718 | ancestor path: foo (node f89532f44c247a0e993d63e3a734dd781ab04708) |
|
720 | ancestor path: foo (node f89532f44c247a0e993d63e3a734dd781ab04708) | |
719 | other path: foo (node f50039b486d6fa1a90ae51778388cad161f425ee) |
|
721 | other path: foo (node f50039b486d6fa1a90ae51778388cad161f425ee) | |
720 | extra: ancestorlinknode = 91360952243723bd5b1138d5f26bd8c8564cb553 |
|
722 | extra: ancestorlinknode = 91360952243723bd5b1138d5f26bd8c8564cb553 | |
721 | extra: merged = yes |
|
723 | extra: merged = yes | |
722 | $ mv .hg/merge/state2 .hg/merge/state2-moved |
|
724 | $ mv .hg/merge/state2 .hg/merge/state2-moved | |
723 | $ hg debugmergestate -v |
|
725 | $ hg debugmergestate -v | |
724 | no version 2 merge state |
|
726 | no version 2 merge state | |
725 | local: b71750c4b0fdf719734971e3ef90dbeab5919a2d |
|
727 | local: b71750c4b0fdf719734971e3ef90dbeab5919a2d | |
726 | other: b71750c4b0fdf719734971e3ef90dbeab5919a2d |
|
728 | other: b71750c4b0fdf719734971e3ef90dbeab5919a2d | |
727 | file: foo (state "u") |
|
729 | file: foo (state "u") | |
728 | local path: foo (hash 0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33, flags "") |
|
730 | local path: foo (hash 0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33, flags "") | |
729 | ancestor path: foo (node f89532f44c247a0e993d63e3a734dd781ab04708) |
|
731 | ancestor path: foo (node f89532f44c247a0e993d63e3a734dd781ab04708) | |
730 | other path: (node foo) |
|
732 | other path: (node foo) | |
731 | $ mv .hg/merge/state2-moved .hg/merge/state2 |
|
733 | $ mv .hg/merge/state2-moved .hg/merge/state2 | |
732 | $ hg resolve -l # still unresolved |
|
734 | $ hg resolve -l # still unresolved | |
733 | U foo |
|
735 | U foo | |
734 | $ hg summary |
|
736 | $ hg summary | |
735 | parent: 2:b71750c4b0fd tip |
|
737 | parent: 2:b71750c4b0fd tip | |
736 | capital ten |
|
738 | capital ten | |
737 | branch: default |
|
739 | branch: default | |
738 | commit: 1 unresolved (clean) |
|
740 | commit: 1 unresolved (clean) | |
739 | update: (current) |
|
741 | update: (current) | |
740 | phases: 3 draft |
|
742 | phases: 3 draft | |
741 | $ hg log -G |
|
743 | $ hg log -G | |
742 | @ changeset: 2:b71750c4b0fd |
|
744 | @ changeset: 2:b71750c4b0fd | |
743 | | tag: tip |
|
745 | | tag: tip | |
744 | | user: test |
|
746 | | user: test | |
745 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
747 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
746 | | summary: capital ten |
|
748 | | summary: capital ten | |
747 | | |
|
749 | | | |
748 | o changeset: 1:913609522437 |
|
750 | o changeset: 1:913609522437 | |
749 | | user: test |
|
751 | | user: test | |
750 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
752 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
751 | | summary: capital three |
|
753 | | summary: capital three | |
752 | | |
|
754 | | | |
753 | % changeset: 0:a30dd8addae3 |
|
755 | % changeset: 0:a30dd8addae3 | |
754 | user: test |
|
756 | user: test | |
755 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
757 | date: Thu Jan 01 00:00:00 1970 +0000 | |
756 | summary: initial |
|
758 | summary: initial | |
757 |
|
759 | |||
758 | $ hg resolve --all --debug |
|
760 | $ hg resolve --all --debug | |
759 | picked tool ':merge' for foo (binary False symlink False changedelete False) |
|
761 | picked tool ':merge' for foo (binary False symlink False changedelete False) | |
760 | merging foo |
|
762 | merging foo | |
761 | my foo@b71750c4b0fd+ other foo@a30dd8addae3 ancestor foo@913609522437 |
|
763 | my foo@b71750c4b0fd+ other foo@a30dd8addae3 ancestor foo@913609522437 | |
762 | premerge successful |
|
764 | premerge successful | |
763 | (no more unresolved files) |
|
765 | (no more unresolved files) | |
764 | continue: hg commit |
|
766 | continue: hg commit | |
765 | $ hg status |
|
767 | $ hg status | |
766 | M foo |
|
768 | M foo | |
767 | ? foo.orig |
|
769 | ? foo.orig | |
768 | $ hg resolve -l |
|
770 | $ hg resolve -l | |
769 | R foo |
|
771 | R foo | |
770 | $ hg summary |
|
772 | $ hg summary | |
771 | parent: 2:b71750c4b0fd tip |
|
773 | parent: 2:b71750c4b0fd tip | |
772 | capital ten |
|
774 | capital ten | |
773 | branch: default |
|
775 | branch: default | |
774 | commit: 1 modified, 1 unknown |
|
776 | commit: 1 modified, 1 unknown | |
775 | update: (current) |
|
777 | update: (current) | |
776 | phases: 3 draft |
|
778 | phases: 3 draft | |
777 | $ cat foo |
|
779 | $ cat foo | |
778 | one |
|
780 | one | |
779 | two |
|
781 | two | |
780 | three |
|
782 | three | |
781 | four |
|
783 | four | |
782 | five |
|
784 | five | |
783 | six |
|
785 | six | |
784 | seven |
|
786 | seven | |
785 | height |
|
787 | height | |
786 | nine |
|
788 | nine | |
787 | TEN |
|
789 | TEN | |
788 |
|
790 | |||
789 | --no-commit shouldn't commit |
|
791 | --no-commit shouldn't commit | |
790 |
|
792 | |||
791 | $ hg init a |
|
793 | $ hg init a | |
792 | $ cd a |
|
794 | $ cd a | |
793 | $ for i in 1 2 3; do |
|
795 | $ for i in 1 2 3; do | |
794 | > touch $i |
|
796 | > touch $i | |
795 | > hg ci -Am $i |
|
797 | > hg ci -Am $i | |
796 | > done |
|
798 | > done | |
797 | adding 1 |
|
799 | adding 1 | |
798 | adding 2 |
|
800 | adding 2 | |
799 | adding 3 |
|
801 | adding 3 | |
800 | $ hg backout --no-commit . |
|
802 | $ hg backout --no-commit . | |
801 | removing 3 |
|
803 | removing 3 | |
802 | changeset cccc23d9d68f backed out, don't forget to commit. |
|
804 | changeset cccc23d9d68f backed out, don't forget to commit. | |
803 | $ hg revert -aq |
|
805 | $ hg revert -aq | |
804 |
|
806 | |||
805 | --no-commit can't be used with --merge |
|
807 | --no-commit can't be used with --merge | |
806 |
|
808 | |||
807 | $ hg backout --merge --no-commit 2 |
|
809 | $ hg backout --merge --no-commit 2 | |
808 | abort: cannot specify both --no-commit and --merge |
|
810 | abort: cannot specify both --no-commit and --merge | |
809 | [10] |
|
811 | [10] | |
810 |
|
812 | |||
811 | Ensure that backout out the same changeset twice performs correctly: |
|
813 | Ensure that backout out the same changeset twice performs correctly: | |
812 |
|
814 | |||
813 | $ hg backout 2 |
|
815 | $ hg backout 2 | |
814 | removing 3 |
|
816 | removing 3 | |
815 | changeset 3:8f188de730d9 backs out changeset 2:cccc23d9d68f |
|
817 | changeset 3:8f188de730d9 backs out changeset 2:cccc23d9d68f | |
816 | $ echo 4 > 4 |
|
818 | $ echo 4 > 4 | |
817 | $ hg ci -A -m 4 |
|
819 | $ hg ci -A -m 4 | |
818 | adding 4 |
|
820 | adding 4 | |
819 | $ hg up 2 |
|
821 | $ hg up 2 | |
820 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
822 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
821 | $ hg backout 2 |
|
823 | $ hg backout 2 | |
822 | removing 3 |
|
824 | removing 3 | |
823 | warning: commit already existed in the repository! |
|
825 | warning: commit already existed in the repository! | |
824 | changeset 3:8f188de730d9 backs out changeset 2:cccc23d9d68f |
|
826 | changeset 3:8f188de730d9 backs out changeset 2:cccc23d9d68f |
General Comments 0
You need to be logged in to leave comments.
Login now