##// END OF EJS Templates
tests: introduce "checkeditform-n-cat.sh" script to invoke "cat" in it safely...
FUJIWARA Katsunori -
r23092:501dc6b1 stable
parent child Browse files
Show More
@@ -1,771 +1,775 b''
1 #require killdaemons
1 #require killdaemons
2
2
3 $ cat <<EOF >> $HGRCPATH
3 $ cat <<EOF >> $HGRCPATH
4 > [extensions]
4 > [extensions]
5 > transplant=
5 > transplant=
6 > EOF
6 > EOF
7
7
8 $ hg init t
8 $ hg init t
9 $ cd t
9 $ cd t
10 $ echo r1 > r1
10 $ echo r1 > r1
11 $ hg ci -Amr1 -d'0 0'
11 $ hg ci -Amr1 -d'0 0'
12 adding r1
12 adding r1
13 $ echo r2 > r2
13 $ echo r2 > r2
14 $ hg ci -Amr2 -d'1 0'
14 $ hg ci -Amr2 -d'1 0'
15 adding r2
15 adding r2
16 $ hg up 0
16 $ hg up 0
17 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
17 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
18
18
19 $ echo b1 > b1
19 $ echo b1 > b1
20 $ hg ci -Amb1 -d '0 0'
20 $ hg ci -Amb1 -d '0 0'
21 adding b1
21 adding b1
22 created new head
22 created new head
23 $ echo b2 > b2
23 $ echo b2 > b2
24 $ hg ci -Amb2 -d '1 0'
24 $ hg ci -Amb2 -d '1 0'
25 adding b2
25 adding b2
26 $ echo b3 > b3
26 $ echo b3 > b3
27 $ hg ci -Amb3 -d '2 0'
27 $ hg ci -Amb3 -d '2 0'
28 adding b3
28 adding b3
29
29
30 $ hg log --template '{rev} {parents} {desc}\n'
30 $ hg log --template '{rev} {parents} {desc}\n'
31 4 b3
31 4 b3
32 3 b2
32 3 b2
33 2 0:17ab29e464c6 b1
33 2 0:17ab29e464c6 b1
34 1 r2
34 1 r2
35 0 r1
35 0 r1
36
36
37 $ hg clone . ../rebase
37 $ hg clone . ../rebase
38 updating to branch default
38 updating to branch default
39 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
39 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
40 $ cd ../rebase
40 $ cd ../rebase
41
41
42 $ hg up -C 1
42 $ hg up -C 1
43 1 files updated, 0 files merged, 3 files removed, 0 files unresolved
43 1 files updated, 0 files merged, 3 files removed, 0 files unresolved
44
44
45 rebase b onto r1
45 rebase b onto r1
46 (this also tests that editor is not invoked if '--edit' is not specified)
46 (this also tests that editor is not invoked if '--edit' is not specified)
47
47
48 $ HGEDITOR=cat hg transplant -a -b tip
48 $ HGEDITOR=cat hg transplant -a -b tip
49 applying 37a1297eb21b
49 applying 37a1297eb21b
50 37a1297eb21b transplanted to e234d668f844
50 37a1297eb21b transplanted to e234d668f844
51 applying 722f4667af76
51 applying 722f4667af76
52 722f4667af76 transplanted to 539f377d78df
52 722f4667af76 transplanted to 539f377d78df
53 applying a53251cdf717
53 applying a53251cdf717
54 a53251cdf717 transplanted to ffd6818a3975
54 a53251cdf717 transplanted to ffd6818a3975
55 $ hg log --template '{rev} {parents} {desc}\n'
55 $ hg log --template '{rev} {parents} {desc}\n'
56 7 b3
56 7 b3
57 6 b2
57 6 b2
58 5 1:d11e3596cc1a b1
58 5 1:d11e3596cc1a b1
59 4 b3
59 4 b3
60 3 b2
60 3 b2
61 2 0:17ab29e464c6 b1
61 2 0:17ab29e464c6 b1
62 1 r2
62 1 r2
63 0 r1
63 0 r1
64
64
65 test transplanted revset
65 test transplanted revset
66
66
67 $ hg log -r 'transplanted()' --template '{rev} {parents} {desc}\n'
67 $ hg log -r 'transplanted()' --template '{rev} {parents} {desc}\n'
68 5 1:d11e3596cc1a b1
68 5 1:d11e3596cc1a b1
69 6 b2
69 6 b2
70 7 b3
70 7 b3
71 $ hg help revsets | grep transplanted
71 $ hg help revsets | grep transplanted
72 "transplanted([set])"
72 "transplanted([set])"
73 Transplanted changesets in set, or all transplanted changesets.
73 Transplanted changesets in set, or all transplanted changesets.
74
74
75 test transplanted keyword
75 test transplanted keyword
76
76
77 $ hg log --template '{rev} {transplanted}\n'
77 $ hg log --template '{rev} {transplanted}\n'
78 7 a53251cdf717679d1907b289f991534be05c997a
78 7 a53251cdf717679d1907b289f991534be05c997a
79 6 722f4667af767100cb15b6a79324bf8abbfe1ef4
79 6 722f4667af767100cb15b6a79324bf8abbfe1ef4
80 5 37a1297eb21b3ef5c5d2ffac22121a0988ed9f21
80 5 37a1297eb21b3ef5c5d2ffac22121a0988ed9f21
81 4
81 4
82 3
82 3
83 2
83 2
84 1
84 1
85 0
85 0
86
86
87 test destination() revset predicate with a transplant of a transplant; new
87 test destination() revset predicate with a transplant of a transplant; new
88 clone so subsequent rollback isn't affected
88 clone so subsequent rollback isn't affected
89 (this also tests that editor is invoked if '--edit' is specified)
89 (this also tests that editor is invoked if '--edit' is specified)
90
90
91 $ hg clone -q . ../destination
91 $ hg clone -q . ../destination
92 $ cd ../destination
92 $ cd ../destination
93 $ hg up -Cq 0
93 $ hg up -Cq 0
94 $ hg branch -q b4
94 $ hg branch -q b4
95 $ hg ci -qm "b4"
95 $ hg ci -qm "b4"
96 $ hg status --rev "7^1" --rev 7
96 $ hg status --rev "7^1" --rev 7
97 A b3
97 A b3
98 $ cat > $TESTTMP/checkeditform.sh <<EOF
98 $ cat > $TESTTMP/checkeditform.sh <<EOF
99 > env | grep HGEDITFORM
99 > env | grep HGEDITFORM
100 > true
100 > true
101 > EOF
101 > EOF
102 $ HGEDITOR="sh $TESTTMP/checkeditform.sh; cat" hg transplant --edit 7
102 $ cat > $TESTTMP/checkeditform-n-cat.sh <<EOF
103 > env | grep HGEDITFORM
104 > cat \$*
105 > EOF
106 $ HGEDITOR="sh $TESTTMP/checkeditform-n-cat.sh" hg transplant --edit 7
103 applying ffd6818a3975
107 applying ffd6818a3975
104 HGEDITFORM=transplant.normal
108 HGEDITFORM=transplant.normal
105 b3
109 b3
106
110
107
111
108 HG: Enter commit message. Lines beginning with 'HG:' are removed.
112 HG: Enter commit message. Lines beginning with 'HG:' are removed.
109 HG: Leave message empty to abort commit.
113 HG: Leave message empty to abort commit.
110 HG: --
114 HG: --
111 HG: user: test
115 HG: user: test
112 HG: branch 'b4'
116 HG: branch 'b4'
113 HG: added b3
117 HG: added b3
114 ffd6818a3975 transplanted to 502236fa76bb
118 ffd6818a3975 transplanted to 502236fa76bb
115
119
116
120
117 $ hg log -r 'destination()'
121 $ hg log -r 'destination()'
118 changeset: 5:e234d668f844
122 changeset: 5:e234d668f844
119 parent: 1:d11e3596cc1a
123 parent: 1:d11e3596cc1a
120 user: test
124 user: test
121 date: Thu Jan 01 00:00:00 1970 +0000
125 date: Thu Jan 01 00:00:00 1970 +0000
122 summary: b1
126 summary: b1
123
127
124 changeset: 6:539f377d78df
128 changeset: 6:539f377d78df
125 user: test
129 user: test
126 date: Thu Jan 01 00:00:01 1970 +0000
130 date: Thu Jan 01 00:00:01 1970 +0000
127 summary: b2
131 summary: b2
128
132
129 changeset: 7:ffd6818a3975
133 changeset: 7:ffd6818a3975
130 user: test
134 user: test
131 date: Thu Jan 01 00:00:02 1970 +0000
135 date: Thu Jan 01 00:00:02 1970 +0000
132 summary: b3
136 summary: b3
133
137
134 changeset: 9:502236fa76bb
138 changeset: 9:502236fa76bb
135 branch: b4
139 branch: b4
136 tag: tip
140 tag: tip
137 user: test
141 user: test
138 date: Thu Jan 01 00:00:02 1970 +0000
142 date: Thu Jan 01 00:00:02 1970 +0000
139 summary: b3
143 summary: b3
140
144
141 $ hg log -r 'destination(a53251cdf717)'
145 $ hg log -r 'destination(a53251cdf717)'
142 changeset: 7:ffd6818a3975
146 changeset: 7:ffd6818a3975
143 user: test
147 user: test
144 date: Thu Jan 01 00:00:02 1970 +0000
148 date: Thu Jan 01 00:00:02 1970 +0000
145 summary: b3
149 summary: b3
146
150
147 changeset: 9:502236fa76bb
151 changeset: 9:502236fa76bb
148 branch: b4
152 branch: b4
149 tag: tip
153 tag: tip
150 user: test
154 user: test
151 date: Thu Jan 01 00:00:02 1970 +0000
155 date: Thu Jan 01 00:00:02 1970 +0000
152 summary: b3
156 summary: b3
153
157
154
158
155 test subset parameter in reverse order
159 test subset parameter in reverse order
156 $ hg log -r 'reverse(all()) and destination(a53251cdf717)'
160 $ hg log -r 'reverse(all()) and destination(a53251cdf717)'
157 changeset: 9:502236fa76bb
161 changeset: 9:502236fa76bb
158 branch: b4
162 branch: b4
159 tag: tip
163 tag: tip
160 user: test
164 user: test
161 date: Thu Jan 01 00:00:02 1970 +0000
165 date: Thu Jan 01 00:00:02 1970 +0000
162 summary: b3
166 summary: b3
163
167
164 changeset: 7:ffd6818a3975
168 changeset: 7:ffd6818a3975
165 user: test
169 user: test
166 date: Thu Jan 01 00:00:02 1970 +0000
170 date: Thu Jan 01 00:00:02 1970 +0000
167 summary: b3
171 summary: b3
168
172
169
173
170 back to the original dir
174 back to the original dir
171 $ cd ../rebase
175 $ cd ../rebase
172
176
173 rollback the transplant
177 rollback the transplant
174 $ hg rollback
178 $ hg rollback
175 repository tip rolled back to revision 4 (undo transplant)
179 repository tip rolled back to revision 4 (undo transplant)
176 working directory now based on revision 1
180 working directory now based on revision 1
177 $ hg tip -q
181 $ hg tip -q
178 4:a53251cdf717
182 4:a53251cdf717
179 $ hg parents -q
183 $ hg parents -q
180 1:d11e3596cc1a
184 1:d11e3596cc1a
181 $ hg status
185 $ hg status
182 ? b1
186 ? b1
183 ? b2
187 ? b2
184 ? b3
188 ? b3
185
189
186 $ hg clone ../t ../prune
190 $ hg clone ../t ../prune
187 updating to branch default
191 updating to branch default
188 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
192 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
189 $ cd ../prune
193 $ cd ../prune
190
194
191 $ hg up -C 1
195 $ hg up -C 1
192 1 files updated, 0 files merged, 3 files removed, 0 files unresolved
196 1 files updated, 0 files merged, 3 files removed, 0 files unresolved
193
197
194 rebase b onto r1, skipping b2
198 rebase b onto r1, skipping b2
195
199
196 $ hg transplant -a -b tip -p 3
200 $ hg transplant -a -b tip -p 3
197 applying 37a1297eb21b
201 applying 37a1297eb21b
198 37a1297eb21b transplanted to e234d668f844
202 37a1297eb21b transplanted to e234d668f844
199 applying a53251cdf717
203 applying a53251cdf717
200 a53251cdf717 transplanted to 7275fda4d04f
204 a53251cdf717 transplanted to 7275fda4d04f
201 $ hg log --template '{rev} {parents} {desc}\n'
205 $ hg log --template '{rev} {parents} {desc}\n'
202 6 b3
206 6 b3
203 5 1:d11e3596cc1a b1
207 5 1:d11e3596cc1a b1
204 4 b3
208 4 b3
205 3 b2
209 3 b2
206 2 0:17ab29e464c6 b1
210 2 0:17ab29e464c6 b1
207 1 r2
211 1 r2
208 0 r1
212 0 r1
209
213
210 test same-parent transplant with --log
214 test same-parent transplant with --log
211
215
212 $ hg clone -r 1 ../t ../sameparent
216 $ hg clone -r 1 ../t ../sameparent
213 adding changesets
217 adding changesets
214 adding manifests
218 adding manifests
215 adding file changes
219 adding file changes
216 added 2 changesets with 2 changes to 2 files
220 added 2 changesets with 2 changes to 2 files
217 updating to branch default
221 updating to branch default
218 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
222 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
219 $ cd ../sameparent
223 $ cd ../sameparent
220 $ hg transplant --log -s ../prune 5
224 $ hg transplant --log -s ../prune 5
221 searching for changes
225 searching for changes
222 applying e234d668f844
226 applying e234d668f844
223 e234d668f844 transplanted to e07aea8ecf9c
227 e234d668f844 transplanted to e07aea8ecf9c
224 $ hg log --template '{rev} {parents} {desc}\n'
228 $ hg log --template '{rev} {parents} {desc}\n'
225 2 b1
229 2 b1
226 (transplanted from e234d668f844e1b1a765f01db83a32c0c7bfa170)
230 (transplanted from e234d668f844e1b1a765f01db83a32c0c7bfa170)
227 1 r2
231 1 r2
228 0 r1
232 0 r1
229 remote transplant
233 remote transplant
230
234
231 $ hg clone -r 1 ../t ../remote
235 $ hg clone -r 1 ../t ../remote
232 adding changesets
236 adding changesets
233 adding manifests
237 adding manifests
234 adding file changes
238 adding file changes
235 added 2 changesets with 2 changes to 2 files
239 added 2 changesets with 2 changes to 2 files
236 updating to branch default
240 updating to branch default
237 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
241 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
238 $ cd ../remote
242 $ cd ../remote
239 $ hg transplant --log -s ../t 2 4
243 $ hg transplant --log -s ../t 2 4
240 searching for changes
244 searching for changes
241 applying 37a1297eb21b
245 applying 37a1297eb21b
242 37a1297eb21b transplanted to c19cf0ccb069
246 37a1297eb21b transplanted to c19cf0ccb069
243 applying a53251cdf717
247 applying a53251cdf717
244 a53251cdf717 transplanted to f7fe5bf98525
248 a53251cdf717 transplanted to f7fe5bf98525
245 $ hg log --template '{rev} {parents} {desc}\n'
249 $ hg log --template '{rev} {parents} {desc}\n'
246 3 b3
250 3 b3
247 (transplanted from a53251cdf717679d1907b289f991534be05c997a)
251 (transplanted from a53251cdf717679d1907b289f991534be05c997a)
248 2 b1
252 2 b1
249 (transplanted from 37a1297eb21b3ef5c5d2ffac22121a0988ed9f21)
253 (transplanted from 37a1297eb21b3ef5c5d2ffac22121a0988ed9f21)
250 1 r2
254 1 r2
251 0 r1
255 0 r1
252
256
253 skip previous transplants
257 skip previous transplants
254
258
255 $ hg transplant -s ../t -a -b 4
259 $ hg transplant -s ../t -a -b 4
256 searching for changes
260 searching for changes
257 applying 722f4667af76
261 applying 722f4667af76
258 722f4667af76 transplanted to 47156cd86c0b
262 722f4667af76 transplanted to 47156cd86c0b
259 $ hg log --template '{rev} {parents} {desc}\n'
263 $ hg log --template '{rev} {parents} {desc}\n'
260 4 b2
264 4 b2
261 3 b3
265 3 b3
262 (transplanted from a53251cdf717679d1907b289f991534be05c997a)
266 (transplanted from a53251cdf717679d1907b289f991534be05c997a)
263 2 b1
267 2 b1
264 (transplanted from 37a1297eb21b3ef5c5d2ffac22121a0988ed9f21)
268 (transplanted from 37a1297eb21b3ef5c5d2ffac22121a0988ed9f21)
265 1 r2
269 1 r2
266 0 r1
270 0 r1
267
271
268 skip local changes transplanted to the source
272 skip local changes transplanted to the source
269
273
270 $ echo b4 > b4
274 $ echo b4 > b4
271 $ hg ci -Amb4 -d '3 0'
275 $ hg ci -Amb4 -d '3 0'
272 adding b4
276 adding b4
273 $ hg clone ../t ../pullback
277 $ hg clone ../t ../pullback
274 updating to branch default
278 updating to branch default
275 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
279 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
276 $ cd ../pullback
280 $ cd ../pullback
277 $ hg transplant -s ../remote -a -b tip
281 $ hg transplant -s ../remote -a -b tip
278 searching for changes
282 searching for changes
279 applying 4333daefcb15
283 applying 4333daefcb15
280 4333daefcb15 transplanted to 5f42c04e07cc
284 4333daefcb15 transplanted to 5f42c04e07cc
281
285
282
286
283 remote transplant with pull
287 remote transplant with pull
284
288
285 $ hg -R ../t serve -p $HGPORT -d --pid-file=../t.pid
289 $ hg -R ../t serve -p $HGPORT -d --pid-file=../t.pid
286 $ cat ../t.pid >> $DAEMON_PIDS
290 $ cat ../t.pid >> $DAEMON_PIDS
287
291
288 $ hg clone -r 0 ../t ../rp
292 $ hg clone -r 0 ../t ../rp
289 adding changesets
293 adding changesets
290 adding manifests
294 adding manifests
291 adding file changes
295 adding file changes
292 added 1 changesets with 1 changes to 1 files
296 added 1 changesets with 1 changes to 1 files
293 updating to branch default
297 updating to branch default
294 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
298 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
295 $ cd ../rp
299 $ cd ../rp
296 $ hg transplant -s http://localhost:$HGPORT/ 2 4
300 $ hg transplant -s http://localhost:$HGPORT/ 2 4
297 searching for changes
301 searching for changes
298 searching for changes
302 searching for changes
299 adding changesets
303 adding changesets
300 adding manifests
304 adding manifests
301 adding file changes
305 adding file changes
302 added 1 changesets with 1 changes to 1 files
306 added 1 changesets with 1 changes to 1 files
303 applying a53251cdf717
307 applying a53251cdf717
304 a53251cdf717 transplanted to 8d9279348abb
308 a53251cdf717 transplanted to 8d9279348abb
305 $ hg log --template '{rev} {parents} {desc}\n'
309 $ hg log --template '{rev} {parents} {desc}\n'
306 2 b3
310 2 b3
307 1 b1
311 1 b1
308 0 r1
312 0 r1
309
313
310 remote transplant without pull
314 remote transplant without pull
311
315
312 $ hg pull -q http://localhost:$HGPORT/
316 $ hg pull -q http://localhost:$HGPORT/
313 $ hg transplant -s http://localhost:$HGPORT/ 2 4
317 $ hg transplant -s http://localhost:$HGPORT/ 2 4
314 searching for changes
318 searching for changes
315 skipping already applied revision 2:8d9279348abb
319 skipping already applied revision 2:8d9279348abb
316 applying 722f4667af76
320 applying 722f4667af76
317 722f4667af76 transplanted to 76e321915884
321 722f4667af76 transplanted to 76e321915884
318
322
319 transplant --continue
323 transplant --continue
320
324
321 $ hg init ../tc
325 $ hg init ../tc
322 $ cd ../tc
326 $ cd ../tc
323 $ cat <<EOF > foo
327 $ cat <<EOF > foo
324 > foo
328 > foo
325 > bar
329 > bar
326 > baz
330 > baz
327 > EOF
331 > EOF
328 $ echo toremove > toremove
332 $ echo toremove > toremove
329 $ echo baz > baz
333 $ echo baz > baz
330 $ hg ci -Amfoo
334 $ hg ci -Amfoo
331 adding baz
335 adding baz
332 adding foo
336 adding foo
333 adding toremove
337 adding toremove
334 $ cat <<EOF > foo
338 $ cat <<EOF > foo
335 > foo2
339 > foo2
336 > bar2
340 > bar2
337 > baz2
341 > baz2
338 > EOF
342 > EOF
339 $ rm toremove
343 $ rm toremove
340 $ echo added > added
344 $ echo added > added
341 $ hg ci -Amfoo2
345 $ hg ci -Amfoo2
342 adding added
346 adding added
343 removing toremove
347 removing toremove
344 $ echo bar > bar
348 $ echo bar > bar
345 $ cat > baz <<EOF
349 $ cat > baz <<EOF
346 > before baz
350 > before baz
347 > baz
351 > baz
348 > after baz
352 > after baz
349 > EOF
353 > EOF
350 $ hg ci -Ambar
354 $ hg ci -Ambar
351 adding bar
355 adding bar
352 $ echo bar2 >> bar
356 $ echo bar2 >> bar
353 $ hg ci -mbar2
357 $ hg ci -mbar2
354 $ hg up 0
358 $ hg up 0
355 3 files updated, 0 files merged, 2 files removed, 0 files unresolved
359 3 files updated, 0 files merged, 2 files removed, 0 files unresolved
356 $ echo foobar > foo
360 $ echo foobar > foo
357 $ hg ci -mfoobar
361 $ hg ci -mfoobar
358 created new head
362 created new head
359 $ hg transplant 1:3
363 $ hg transplant 1:3
360 applying 46ae92138f3c
364 applying 46ae92138f3c
361 patching file foo
365 patching file foo
362 Hunk #1 FAILED at 0
366 Hunk #1 FAILED at 0
363 1 out of 1 hunks FAILED -- saving rejects to file foo.rej
367 1 out of 1 hunks FAILED -- saving rejects to file foo.rej
364 patch failed to apply
368 patch failed to apply
365 abort: fix up the merge and run hg transplant --continue
369 abort: fix up the merge and run hg transplant --continue
366 [255]
370 [255]
367
371
368 transplant -c shouldn't use an old changeset
372 transplant -c shouldn't use an old changeset
369
373
370 $ hg up -C
374 $ hg up -C
371 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
375 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
372 $ rm added
376 $ rm added
373 $ hg transplant 1
377 $ hg transplant 1
374 applying 46ae92138f3c
378 applying 46ae92138f3c
375 patching file foo
379 patching file foo
376 Hunk #1 FAILED at 0
380 Hunk #1 FAILED at 0
377 1 out of 1 hunks FAILED -- saving rejects to file foo.rej
381 1 out of 1 hunks FAILED -- saving rejects to file foo.rej
378 patch failed to apply
382 patch failed to apply
379 abort: fix up the merge and run hg transplant --continue
383 abort: fix up the merge and run hg transplant --continue
380 [255]
384 [255]
381 $ HGEDITOR="sh $TESTTMP/checkeditform.sh" hg transplant --continue -e
385 $ HGEDITOR="sh $TESTTMP/checkeditform.sh" hg transplant --continue -e
382 HGEDITFORM=transplant.normal
386 HGEDITFORM=transplant.normal
383 46ae92138f3c transplanted as 9159dada197d
387 46ae92138f3c transplanted as 9159dada197d
384 $ hg transplant 1:3
388 $ hg transplant 1:3
385 skipping already applied revision 1:46ae92138f3c
389 skipping already applied revision 1:46ae92138f3c
386 applying 9d6d6b5a8275
390 applying 9d6d6b5a8275
387 9d6d6b5a8275 transplanted to 2d17a10c922f
391 9d6d6b5a8275 transplanted to 2d17a10c922f
388 applying 1dab759070cf
392 applying 1dab759070cf
389 1dab759070cf transplanted to e06a69927eb0
393 1dab759070cf transplanted to e06a69927eb0
390 $ hg locate
394 $ hg locate
391 added
395 added
392 bar
396 bar
393 baz
397 baz
394 foo
398 foo
395
399
396 test multiple revisions and --continue
400 test multiple revisions and --continue
397
401
398 $ hg up -qC 0
402 $ hg up -qC 0
399 $ echo bazbaz > baz
403 $ echo bazbaz > baz
400 $ hg ci -Am anotherbaz baz
404 $ hg ci -Am anotherbaz baz
401 created new head
405 created new head
402 $ hg transplant 1:3
406 $ hg transplant 1:3
403 applying 46ae92138f3c
407 applying 46ae92138f3c
404 46ae92138f3c transplanted to 1024233ea0ba
408 46ae92138f3c transplanted to 1024233ea0ba
405 applying 9d6d6b5a8275
409 applying 9d6d6b5a8275
406 patching file baz
410 patching file baz
407 Hunk #1 FAILED at 0
411 Hunk #1 FAILED at 0
408 1 out of 1 hunks FAILED -- saving rejects to file baz.rej
412 1 out of 1 hunks FAILED -- saving rejects to file baz.rej
409 patch failed to apply
413 patch failed to apply
410 abort: fix up the merge and run hg transplant --continue
414 abort: fix up the merge and run hg transplant --continue
411 [255]
415 [255]
412 $ echo fixed > baz
416 $ echo fixed > baz
413 $ hg transplant --continue
417 $ hg transplant --continue
414 9d6d6b5a8275 transplanted as d80c49962290
418 9d6d6b5a8275 transplanted as d80c49962290
415 applying 1dab759070cf
419 applying 1dab759070cf
416 1dab759070cf transplanted to aa0ffe6bd5ae
420 1dab759070cf transplanted to aa0ffe6bd5ae
417
421
418 $ cd ..
422 $ cd ..
419
423
420 Issue1111: Test transplant --merge
424 Issue1111: Test transplant --merge
421
425
422 $ hg init t1111
426 $ hg init t1111
423 $ cd t1111
427 $ cd t1111
424 $ echo a > a
428 $ echo a > a
425 $ hg ci -Am adda
429 $ hg ci -Am adda
426 adding a
430 adding a
427 $ echo b >> a
431 $ echo b >> a
428 $ hg ci -m appendb
432 $ hg ci -m appendb
429 $ echo c >> a
433 $ echo c >> a
430 $ hg ci -m appendc
434 $ hg ci -m appendc
431 $ hg up -C 0
435 $ hg up -C 0
432 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
436 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
433 $ echo d >> a
437 $ echo d >> a
434 $ hg ci -m appendd
438 $ hg ci -m appendd
435 created new head
439 created new head
436
440
437 transplant
441 transplant
438
442
439 $ HGEDITOR="sh $TESTTMP/checkeditform.sh" hg transplant -m 1 -e
443 $ HGEDITOR="sh $TESTTMP/checkeditform.sh" hg transplant -m 1 -e
440 applying 42dc4432fd35
444 applying 42dc4432fd35
441 HGEDITFORM=transplant.merge
445 HGEDITFORM=transplant.merge
442 1:42dc4432fd35 merged at a9f4acbac129
446 1:42dc4432fd35 merged at a9f4acbac129
443 $ hg update -q -C 2
447 $ hg update -q -C 2
444 $ cat > a <<EOF
448 $ cat > a <<EOF
445 > x
449 > x
446 > y
450 > y
447 > z
451 > z
448 > EOF
452 > EOF
449 $ hg commit -m replace
453 $ hg commit -m replace
450 $ hg update -q -C 4
454 $ hg update -q -C 4
451 $ hg transplant -m 5
455 $ hg transplant -m 5
452 applying 600a3cdcb41d
456 applying 600a3cdcb41d
453 patching file a
457 patching file a
454 Hunk #1 FAILED at 0
458 Hunk #1 FAILED at 0
455 1 out of 1 hunks FAILED -- saving rejects to file a.rej
459 1 out of 1 hunks FAILED -- saving rejects to file a.rej
456 patch failed to apply
460 patch failed to apply
457 abort: fix up the merge and run hg transplant --continue
461 abort: fix up the merge and run hg transplant --continue
458 [255]
462 [255]
459 $ HGEDITOR="sh $TESTTMP/checkeditform.sh" hg transplant --continue -e
463 $ HGEDITOR="sh $TESTTMP/checkeditform.sh" hg transplant --continue -e
460 HGEDITFORM=transplant.merge
464 HGEDITFORM=transplant.merge
461 600a3cdcb41d transplanted as a3f88be652e0
465 600a3cdcb41d transplanted as a3f88be652e0
462
466
463 $ cd ..
467 $ cd ..
464
468
465 test transplant into empty repository
469 test transplant into empty repository
466
470
467 $ hg init empty
471 $ hg init empty
468 $ cd empty
472 $ cd empty
469 $ hg transplant -s ../t -b tip -a
473 $ hg transplant -s ../t -b tip -a
470 adding changesets
474 adding changesets
471 adding manifests
475 adding manifests
472 adding file changes
476 adding file changes
473 added 4 changesets with 4 changes to 4 files
477 added 4 changesets with 4 changes to 4 files
474
478
475 test "--merge" causing pull from source repository on local host
479 test "--merge" causing pull from source repository on local host
476
480
477 $ hg --config extensions.mq= -q strip 2
481 $ hg --config extensions.mq= -q strip 2
478 $ hg transplant -s ../t --merge tip
482 $ hg transplant -s ../t --merge tip
479 searching for changes
483 searching for changes
480 searching for changes
484 searching for changes
481 adding changesets
485 adding changesets
482 adding manifests
486 adding manifests
483 adding file changes
487 adding file changes
484 added 2 changesets with 2 changes to 2 files
488 added 2 changesets with 2 changes to 2 files
485 applying a53251cdf717
489 applying a53251cdf717
486 4:a53251cdf717 merged at 4831f4dc831a
490 4:a53251cdf717 merged at 4831f4dc831a
487
491
488 test interactive transplant
492 test interactive transplant
489
493
490 $ hg --config extensions.strip= -q strip 0
494 $ hg --config extensions.strip= -q strip 0
491 $ hg -R ../t log -G --template "{rev}:{node|short}"
495 $ hg -R ../t log -G --template "{rev}:{node|short}"
492 @ 4:a53251cdf717
496 @ 4:a53251cdf717
493 |
497 |
494 o 3:722f4667af76
498 o 3:722f4667af76
495 |
499 |
496 o 2:37a1297eb21b
500 o 2:37a1297eb21b
497 |
501 |
498 | o 1:d11e3596cc1a
502 | o 1:d11e3596cc1a
499 |/
503 |/
500 o 0:17ab29e464c6
504 o 0:17ab29e464c6
501
505
502 $ hg transplant -q --config ui.interactive=true -s ../t <<EOF
506 $ hg transplant -q --config ui.interactive=true -s ../t <<EOF
503 > p
507 > p
504 > y
508 > y
505 > n
509 > n
506 > n
510 > n
507 > m
511 > m
508 > c
512 > c
509 > EOF
513 > EOF
510 0:17ab29e464c6
514 0:17ab29e464c6
511 apply changeset? [ynmpcq?]: p
515 apply changeset? [ynmpcq?]: p
512 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
516 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
513 +++ b/r1 Thu Jan 01 00:00:00 1970 +0000
517 +++ b/r1 Thu Jan 01 00:00:00 1970 +0000
514 @@ -0,0 +1,1 @@
518 @@ -0,0 +1,1 @@
515 +r1
519 +r1
516 apply changeset? [ynmpcq?]: y
520 apply changeset? [ynmpcq?]: y
517 1:d11e3596cc1a
521 1:d11e3596cc1a
518 apply changeset? [ynmpcq?]: n
522 apply changeset? [ynmpcq?]: n
519 2:37a1297eb21b
523 2:37a1297eb21b
520 apply changeset? [ynmpcq?]: n
524 apply changeset? [ynmpcq?]: n
521 3:722f4667af76
525 3:722f4667af76
522 apply changeset? [ynmpcq?]: m
526 apply changeset? [ynmpcq?]: m
523 4:a53251cdf717
527 4:a53251cdf717
524 apply changeset? [ynmpcq?]: c
528 apply changeset? [ynmpcq?]: c
525 $ hg log -G --template "{node|short}"
529 $ hg log -G --template "{node|short}"
526 @ 88be5dde5260
530 @ 88be5dde5260
527 |\
531 |\
528 | o 722f4667af76
532 | o 722f4667af76
529 | |
533 | |
530 | o 37a1297eb21b
534 | o 37a1297eb21b
531 |/
535 |/
532 o 17ab29e464c6
536 o 17ab29e464c6
533
537
534 $ hg transplant -q --config ui.interactive=true -s ../t <<EOF
538 $ hg transplant -q --config ui.interactive=true -s ../t <<EOF
535 > x
539 > x
536 > ?
540 > ?
537 > y
541 > y
538 > q
542 > q
539 > EOF
543 > EOF
540 1:d11e3596cc1a
544 1:d11e3596cc1a
541 apply changeset? [ynmpcq?]: x
545 apply changeset? [ynmpcq?]: x
542 unrecognized response
546 unrecognized response
543 apply changeset? [ynmpcq?]: ?
547 apply changeset? [ynmpcq?]: ?
544 y: yes, transplant this changeset
548 y: yes, transplant this changeset
545 n: no, skip this changeset
549 n: no, skip this changeset
546 m: merge at this changeset
550 m: merge at this changeset
547 p: show patch
551 p: show patch
548 c: commit selected changesets
552 c: commit selected changesets
549 q: quit and cancel transplant
553 q: quit and cancel transplant
550 ?: ? (show this help)
554 ?: ? (show this help)
551 apply changeset? [ynmpcq?]: y
555 apply changeset? [ynmpcq?]: y
552 4:a53251cdf717
556 4:a53251cdf717
553 apply changeset? [ynmpcq?]: q
557 apply changeset? [ynmpcq?]: q
554 $ hg heads --template "{node|short}\n"
558 $ hg heads --template "{node|short}\n"
555 88be5dde5260
559 88be5dde5260
556
560
557 $ cd ..
561 $ cd ..
558
562
559
563
560 #if unix-permissions system-sh
564 #if unix-permissions system-sh
561
565
562 test filter
566 test filter
563
567
564 $ hg init filter
568 $ hg init filter
565 $ cd filter
569 $ cd filter
566 $ cat <<'EOF' >test-filter
570 $ cat <<'EOF' >test-filter
567 > #!/bin/sh
571 > #!/bin/sh
568 > sed 's/r1/r2/' $1 > $1.new
572 > sed 's/r1/r2/' $1 > $1.new
569 > mv $1.new $1
573 > mv $1.new $1
570 > EOF
574 > EOF
571 $ chmod +x test-filter
575 $ chmod +x test-filter
572 $ hg transplant -s ../t -b tip -a --filter ./test-filter
576 $ hg transplant -s ../t -b tip -a --filter ./test-filter
573 filtering * (glob)
577 filtering * (glob)
574 applying 17ab29e464c6
578 applying 17ab29e464c6
575 17ab29e464c6 transplanted to e9ffc54ea104
579 17ab29e464c6 transplanted to e9ffc54ea104
576 filtering * (glob)
580 filtering * (glob)
577 applying 37a1297eb21b
581 applying 37a1297eb21b
578 37a1297eb21b transplanted to 348b36d0b6a5
582 37a1297eb21b transplanted to 348b36d0b6a5
579 filtering * (glob)
583 filtering * (glob)
580 applying 722f4667af76
584 applying 722f4667af76
581 722f4667af76 transplanted to 0aa6979afb95
585 722f4667af76 transplanted to 0aa6979afb95
582 filtering * (glob)
586 filtering * (glob)
583 applying a53251cdf717
587 applying a53251cdf717
584 a53251cdf717 transplanted to 14f8512272b5
588 a53251cdf717 transplanted to 14f8512272b5
585 $ hg log --template '{rev} {parents} {desc}\n'
589 $ hg log --template '{rev} {parents} {desc}\n'
586 3 b3
590 3 b3
587 2 b2
591 2 b2
588 1 b1
592 1 b1
589 0 r2
593 0 r2
590 $ cd ..
594 $ cd ..
591
595
592
596
593 test filter with failed patch
597 test filter with failed patch
594
598
595 $ cd filter
599 $ cd filter
596 $ hg up 0
600 $ hg up 0
597 0 files updated, 0 files merged, 3 files removed, 0 files unresolved
601 0 files updated, 0 files merged, 3 files removed, 0 files unresolved
598 $ echo foo > b1
602 $ echo foo > b1
599 $ hg ci -Am foo
603 $ hg ci -Am foo
600 adding b1
604 adding b1
601 adding test-filter
605 adding test-filter
602 created new head
606 created new head
603 $ hg transplant 1 --filter ./test-filter
607 $ hg transplant 1 --filter ./test-filter
604 filtering * (glob)
608 filtering * (glob)
605 applying 348b36d0b6a5
609 applying 348b36d0b6a5
606 file b1 already exists
610 file b1 already exists
607 1 out of 1 hunks FAILED -- saving rejects to file b1.rej
611 1 out of 1 hunks FAILED -- saving rejects to file b1.rej
608 patch failed to apply
612 patch failed to apply
609 abort: fix up the merge and run hg transplant --continue
613 abort: fix up the merge and run hg transplant --continue
610 [255]
614 [255]
611 $ cd ..
615 $ cd ..
612
616
613 test environment passed to filter
617 test environment passed to filter
614
618
615 $ hg init filter-environment
619 $ hg init filter-environment
616 $ cd filter-environment
620 $ cd filter-environment
617 $ cat <<'EOF' >test-filter-environment
621 $ cat <<'EOF' >test-filter-environment
618 > #!/bin/sh
622 > #!/bin/sh
619 > echo "Transplant by $HGUSER" >> $1
623 > echo "Transplant by $HGUSER" >> $1
620 > echo "Transplant from rev $HGREVISION" >> $1
624 > echo "Transplant from rev $HGREVISION" >> $1
621 > EOF
625 > EOF
622 $ chmod +x test-filter-environment
626 $ chmod +x test-filter-environment
623 $ hg transplant -s ../t --filter ./test-filter-environment 0
627 $ hg transplant -s ../t --filter ./test-filter-environment 0
624 filtering * (glob)
628 filtering * (glob)
625 applying 17ab29e464c6
629 applying 17ab29e464c6
626 17ab29e464c6 transplanted to 5190e68026a0
630 17ab29e464c6 transplanted to 5190e68026a0
627
631
628 $ hg log --template '{rev} {parents} {desc}\n'
632 $ hg log --template '{rev} {parents} {desc}\n'
629 0 r1
633 0 r1
630 Transplant by test
634 Transplant by test
631 Transplant from rev 17ab29e464c6ca53e329470efe2a9918ac617a6f
635 Transplant from rev 17ab29e464c6ca53e329470efe2a9918ac617a6f
632 $ cd ..
636 $ cd ..
633
637
634 test transplant with filter handles invalid changelog
638 test transplant with filter handles invalid changelog
635
639
636 $ hg init filter-invalid-log
640 $ hg init filter-invalid-log
637 $ cd filter-invalid-log
641 $ cd filter-invalid-log
638 $ cat <<'EOF' >test-filter-invalid-log
642 $ cat <<'EOF' >test-filter-invalid-log
639 > #!/bin/sh
643 > #!/bin/sh
640 > echo "" > $1
644 > echo "" > $1
641 > EOF
645 > EOF
642 $ chmod +x test-filter-invalid-log
646 $ chmod +x test-filter-invalid-log
643 $ hg transplant -s ../t --filter ./test-filter-invalid-log 0
647 $ hg transplant -s ../t --filter ./test-filter-invalid-log 0
644 filtering * (glob)
648 filtering * (glob)
645 abort: filter corrupted changeset (no user or date)
649 abort: filter corrupted changeset (no user or date)
646 [255]
650 [255]
647 $ cd ..
651 $ cd ..
648
652
649 #endif
653 #endif
650
654
651
655
652 test with a win32ext like setup (differing EOLs)
656 test with a win32ext like setup (differing EOLs)
653
657
654 $ hg init twin1
658 $ hg init twin1
655 $ cd twin1
659 $ cd twin1
656 $ echo a > a
660 $ echo a > a
657 $ echo b > b
661 $ echo b > b
658 $ echo b >> b
662 $ echo b >> b
659 $ hg ci -Am t
663 $ hg ci -Am t
660 adding a
664 adding a
661 adding b
665 adding b
662 $ echo a > b
666 $ echo a > b
663 $ echo b >> b
667 $ echo b >> b
664 $ hg ci -m changeb
668 $ hg ci -m changeb
665 $ cd ..
669 $ cd ..
666
670
667 $ hg init twin2
671 $ hg init twin2
668 $ cd twin2
672 $ cd twin2
669 $ echo '[patch]' >> .hg/hgrc
673 $ echo '[patch]' >> .hg/hgrc
670 $ echo 'eol = crlf' >> .hg/hgrc
674 $ echo 'eol = crlf' >> .hg/hgrc
671 $ $PYTHON -c "file('b', 'wb').write('b\r\nb\r\n')"
675 $ $PYTHON -c "file('b', 'wb').write('b\r\nb\r\n')"
672 $ hg ci -Am addb
676 $ hg ci -Am addb
673 adding b
677 adding b
674 $ hg transplant -s ../twin1 tip
678 $ hg transplant -s ../twin1 tip
675 searching for changes
679 searching for changes
676 warning: repository is unrelated
680 warning: repository is unrelated
677 applying 2e849d776c17
681 applying 2e849d776c17
678 2e849d776c17 transplanted to 8e65bebc063e
682 2e849d776c17 transplanted to 8e65bebc063e
679 $ cat b
683 $ cat b
680 a\r (esc)
684 a\r (esc)
681 b\r (esc)
685 b\r (esc)
682 $ cd ..
686 $ cd ..
683
687
684 test transplant with merge changeset is skipped
688 test transplant with merge changeset is skipped
685
689
686 $ hg init merge1a
690 $ hg init merge1a
687 $ cd merge1a
691 $ cd merge1a
688 $ echo a > a
692 $ echo a > a
689 $ hg ci -Am a
693 $ hg ci -Am a
690 adding a
694 adding a
691 $ hg branch b
695 $ hg branch b
692 marked working directory as branch b
696 marked working directory as branch b
693 (branches are permanent and global, did you want a bookmark?)
697 (branches are permanent and global, did you want a bookmark?)
694 $ hg ci -m branchb
698 $ hg ci -m branchb
695 $ echo b > b
699 $ echo b > b
696 $ hg ci -Am b
700 $ hg ci -Am b
697 adding b
701 adding b
698 $ hg update default
702 $ hg update default
699 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
703 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
700 $ hg merge b
704 $ hg merge b
701 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
705 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
702 (branch merge, don't forget to commit)
706 (branch merge, don't forget to commit)
703 $ hg ci -m mergeb
707 $ hg ci -m mergeb
704 $ cd ..
708 $ cd ..
705
709
706 $ hg init merge1b
710 $ hg init merge1b
707 $ cd merge1b
711 $ cd merge1b
708 $ hg transplant -s ../merge1a tip
712 $ hg transplant -s ../merge1a tip
709 $ cd ..
713 $ cd ..
710
714
711 test transplant with merge changeset accepts --parent
715 test transplant with merge changeset accepts --parent
712
716
713 $ hg init merge2a
717 $ hg init merge2a
714 $ cd merge2a
718 $ cd merge2a
715 $ echo a > a
719 $ echo a > a
716 $ hg ci -Am a
720 $ hg ci -Am a
717 adding a
721 adding a
718 $ hg branch b
722 $ hg branch b
719 marked working directory as branch b
723 marked working directory as branch b
720 (branches are permanent and global, did you want a bookmark?)
724 (branches are permanent and global, did you want a bookmark?)
721 $ hg ci -m branchb
725 $ hg ci -m branchb
722 $ echo b > b
726 $ echo b > b
723 $ hg ci -Am b
727 $ hg ci -Am b
724 adding b
728 adding b
725 $ hg update default
729 $ hg update default
726 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
730 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
727 $ hg merge b
731 $ hg merge b
728 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
732 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
729 (branch merge, don't forget to commit)
733 (branch merge, don't forget to commit)
730 $ hg ci -m mergeb
734 $ hg ci -m mergeb
731 $ cd ..
735 $ cd ..
732
736
733 $ hg init merge2b
737 $ hg init merge2b
734 $ cd merge2b
738 $ cd merge2b
735 $ hg transplant -s ../merge2a --parent 0 tip
739 $ hg transplant -s ../merge2a --parent 0 tip
736 applying be9f9b39483f
740 applying be9f9b39483f
737 be9f9b39483f transplanted to 9959e51f94d1
741 be9f9b39483f transplanted to 9959e51f94d1
738 $ cd ..
742 $ cd ..
739
743
740 test transplanting a patch turning into a no-op
744 test transplanting a patch turning into a no-op
741
745
742 $ hg init binarysource
746 $ hg init binarysource
743 $ cd binarysource
747 $ cd binarysource
744 $ echo a > a
748 $ echo a > a
745 $ hg ci -Am adda a
749 $ hg ci -Am adda a
746 >>> file('b', 'wb').write('\0b1')
750 >>> file('b', 'wb').write('\0b1')
747 $ hg ci -Am addb b
751 $ hg ci -Am addb b
748 >>> file('b', 'wb').write('\0b2')
752 >>> file('b', 'wb').write('\0b2')
749 $ hg ci -m changeb b
753 $ hg ci -m changeb b
750 $ cd ..
754 $ cd ..
751
755
752 $ hg clone -r0 binarysource binarydest
756 $ hg clone -r0 binarysource binarydest
753 adding changesets
757 adding changesets
754 adding manifests
758 adding manifests
755 adding file changes
759 adding file changes
756 added 1 changesets with 1 changes to 1 files
760 added 1 changesets with 1 changes to 1 files
757 updating to branch default
761 updating to branch default
758 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
762 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
759 $ cd binarydest
763 $ cd binarydest
760 $ cp ../binarysource/b b
764 $ cp ../binarysource/b b
761 $ hg ci -Am addb2 b
765 $ hg ci -Am addb2 b
762 $ hg transplant -s ../binarysource 2
766 $ hg transplant -s ../binarysource 2
763 searching for changes
767 searching for changes
764 applying 7a7d57e15850
768 applying 7a7d57e15850
765 skipping emptied changeset 7a7d57e15850
769 skipping emptied changeset 7a7d57e15850
766 $ cd ..
770 $ cd ..
767
771
768 Explicitly kill daemons to let the test exit on Windows
772 Explicitly kill daemons to let the test exit on Windows
769
773
770 $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
774 $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
771
775
General Comments 0
You need to be logged in to leave comments. Login now