##// END OF EJS Templates
test-transplant: fix missing file addition
Patrick Mezard -
r14012:b247123d stable
parent child Browse files
Show More
@@ -1,363 +1,364 b''
1 $ cat <<EOF >> $HGRCPATH
1 $ cat <<EOF >> $HGRCPATH
2 > [extensions]
2 > [extensions]
3 > transplant=
3 > transplant=
4 > EOF
4 > EOF
5
5
6 $ hg init t
6 $ hg init t
7 $ cd t
7 $ cd t
8 $ echo r1 > r1
8 $ echo r1 > r1
9 $ hg ci -Amr1 -d'0 0'
9 $ hg ci -Amr1 -d'0 0'
10 adding r1
10 adding r1
11 $ echo r2 > r2
11 $ echo r2 > r2
12 $ hg ci -Amr2 -d'1 0'
12 $ hg ci -Amr2 -d'1 0'
13 adding r2
13 adding r2
14 $ hg up 0
14 $ hg up 0
15 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
15 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
16
16
17 $ echo b1 > b1
17 $ echo b1 > b1
18 $ hg ci -Amb1 -d '0 0'
18 $ hg ci -Amb1 -d '0 0'
19 adding b1
19 adding b1
20 created new head
20 created new head
21 $ echo b2 > b2
21 $ echo b2 > b2
22 $ hg ci -Amb2 -d '1 0'
22 $ hg ci -Amb2 -d '1 0'
23 adding b2
23 adding b2
24 $ echo b3 > b3
24 $ echo b3 > b3
25 $ hg ci -Amb3 -d '2 0'
25 $ hg ci -Amb3 -d '2 0'
26 adding b3
26 adding b3
27
27
28 $ hg log --template '{rev} {parents} {desc}\n'
28 $ hg log --template '{rev} {parents} {desc}\n'
29 4 b3
29 4 b3
30 3 b2
30 3 b2
31 2 0:17ab29e464c6 b1
31 2 0:17ab29e464c6 b1
32 1 r2
32 1 r2
33 0 r1
33 0 r1
34
34
35 $ hg clone . ../rebase
35 $ hg clone . ../rebase
36 updating to branch default
36 updating to branch default
37 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
37 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
38 $ cd ../rebase
38 $ cd ../rebase
39
39
40 $ hg up -C 1
40 $ hg up -C 1
41 1 files updated, 0 files merged, 3 files removed, 0 files unresolved
41 1 files updated, 0 files merged, 3 files removed, 0 files unresolved
42
42
43 rebase b onto r1
43 rebase b onto r1
44
44
45 $ hg transplant -a -b tip
45 $ hg transplant -a -b tip
46 applying 37a1297eb21b
46 applying 37a1297eb21b
47 37a1297eb21b transplanted to e234d668f844
47 37a1297eb21b transplanted to e234d668f844
48 applying 722f4667af76
48 applying 722f4667af76
49 722f4667af76 transplanted to 539f377d78df
49 722f4667af76 transplanted to 539f377d78df
50 applying a53251cdf717
50 applying a53251cdf717
51 a53251cdf717 transplanted to ffd6818a3975
51 a53251cdf717 transplanted to ffd6818a3975
52 $ hg log --template '{rev} {parents} {desc}\n'
52 $ hg log --template '{rev} {parents} {desc}\n'
53 7 b3
53 7 b3
54 6 b2
54 6 b2
55 5 1:d11e3596cc1a b1
55 5 1:d11e3596cc1a b1
56 4 b3
56 4 b3
57 3 b2
57 3 b2
58 2 0:17ab29e464c6 b1
58 2 0:17ab29e464c6 b1
59 1 r2
59 1 r2
60 0 r1
60 0 r1
61
61
62 test transplanted revset
62 test transplanted revset
63
63
64 $ hg log -r 'transplanted()' --template '{rev} {parents} {desc}\n'
64 $ hg log -r 'transplanted()' --template '{rev} {parents} {desc}\n'
65 5 1:d11e3596cc1a b1
65 5 1:d11e3596cc1a b1
66 6 b2
66 6 b2
67 7 b3
67 7 b3
68 $ hg help revsets | grep transplanted
68 $ hg help revsets | grep transplanted
69 "transplanted(set)"
69 "transplanted(set)"
70
70
71 $ hg clone ../t ../prune
71 $ hg clone ../t ../prune
72 updating to branch default
72 updating to branch default
73 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
73 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
74 $ cd ../prune
74 $ cd ../prune
75
75
76 $ hg up -C 1
76 $ hg up -C 1
77 1 files updated, 0 files merged, 3 files removed, 0 files unresolved
77 1 files updated, 0 files merged, 3 files removed, 0 files unresolved
78
78
79 rebase b onto r1, skipping b2
79 rebase b onto r1, skipping b2
80
80
81 $ hg transplant -a -b tip -p 3
81 $ hg transplant -a -b tip -p 3
82 applying 37a1297eb21b
82 applying 37a1297eb21b
83 37a1297eb21b transplanted to e234d668f844
83 37a1297eb21b transplanted to e234d668f844
84 applying a53251cdf717
84 applying a53251cdf717
85 a53251cdf717 transplanted to 7275fda4d04f
85 a53251cdf717 transplanted to 7275fda4d04f
86 $ hg log --template '{rev} {parents} {desc}\n'
86 $ hg log --template '{rev} {parents} {desc}\n'
87 6 b3
87 6 b3
88 5 1:d11e3596cc1a b1
88 5 1:d11e3596cc1a b1
89 4 b3
89 4 b3
90 3 b2
90 3 b2
91 2 0:17ab29e464c6 b1
91 2 0:17ab29e464c6 b1
92 1 r2
92 1 r2
93 0 r1
93 0 r1
94
94
95
95
96 remote transplant
96 remote transplant
97
97
98 $ hg clone -r 1 ../t ../remote
98 $ hg clone -r 1 ../t ../remote
99 adding changesets
99 adding changesets
100 adding manifests
100 adding manifests
101 adding file changes
101 adding file changes
102 added 2 changesets with 2 changes to 2 files
102 added 2 changesets with 2 changes to 2 files
103 updating to branch default
103 updating to branch default
104 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
104 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
105 $ cd ../remote
105 $ cd ../remote
106 $ hg transplant --log -s ../t 2 4
106 $ hg transplant --log -s ../t 2 4
107 searching for changes
107 searching for changes
108 applying 37a1297eb21b
108 applying 37a1297eb21b
109 37a1297eb21b transplanted to c19cf0ccb069
109 37a1297eb21b transplanted to c19cf0ccb069
110 applying a53251cdf717
110 applying a53251cdf717
111 a53251cdf717 transplanted to f7fe5bf98525
111 a53251cdf717 transplanted to f7fe5bf98525
112 $ hg log --template '{rev} {parents} {desc}\n'
112 $ hg log --template '{rev} {parents} {desc}\n'
113 3 b3
113 3 b3
114 (transplanted from a53251cdf717679d1907b289f991534be05c997a)
114 (transplanted from a53251cdf717679d1907b289f991534be05c997a)
115 2 b1
115 2 b1
116 (transplanted from 37a1297eb21b3ef5c5d2ffac22121a0988ed9f21)
116 (transplanted from 37a1297eb21b3ef5c5d2ffac22121a0988ed9f21)
117 1 r2
117 1 r2
118 0 r1
118 0 r1
119
119
120 skip previous transplants
120 skip previous transplants
121
121
122 $ hg transplant -s ../t -a -b 4
122 $ hg transplant -s ../t -a -b 4
123 searching for changes
123 searching for changes
124 applying 722f4667af76
124 applying 722f4667af76
125 722f4667af76 transplanted to 47156cd86c0b
125 722f4667af76 transplanted to 47156cd86c0b
126 $ hg log --template '{rev} {parents} {desc}\n'
126 $ hg log --template '{rev} {parents} {desc}\n'
127 4 b2
127 4 b2
128 3 b3
128 3 b3
129 (transplanted from a53251cdf717679d1907b289f991534be05c997a)
129 (transplanted from a53251cdf717679d1907b289f991534be05c997a)
130 2 b1
130 2 b1
131 (transplanted from 37a1297eb21b3ef5c5d2ffac22121a0988ed9f21)
131 (transplanted from 37a1297eb21b3ef5c5d2ffac22121a0988ed9f21)
132 1 r2
132 1 r2
133 0 r1
133 0 r1
134
134
135 skip local changes transplanted to the source
135 skip local changes transplanted to the source
136
136
137 $ echo b4 > b4
137 $ echo b4 > b4
138 $ hg ci -Amb4 -d '3 0'
138 $ hg ci -Amb4 -d '3 0'
139 adding b4
139 adding b4
140 $ hg clone ../t ../pullback
140 $ hg clone ../t ../pullback
141 updating to branch default
141 updating to branch default
142 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
142 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
143 $ cd ../pullback
143 $ cd ../pullback
144 $ hg transplant -s ../remote -a -b tip
144 $ hg transplant -s ../remote -a -b tip
145 searching for changes
145 searching for changes
146 applying 4333daefcb15
146 applying 4333daefcb15
147 4333daefcb15 transplanted to 5f42c04e07cc
147 4333daefcb15 transplanted to 5f42c04e07cc
148
148
149
149
150 remote transplant with pull
150 remote transplant with pull
151
151
152 $ hg -R ../t serve -p $HGPORT -d --pid-file=../t.pid
152 $ hg -R ../t serve -p $HGPORT -d --pid-file=../t.pid
153 $ cat ../t.pid >> $DAEMON_PIDS
153 $ cat ../t.pid >> $DAEMON_PIDS
154
154
155 $ hg clone -r 0 ../t ../rp
155 $ hg clone -r 0 ../t ../rp
156 adding changesets
156 adding changesets
157 adding manifests
157 adding manifests
158 adding file changes
158 adding file changes
159 added 1 changesets with 1 changes to 1 files
159 added 1 changesets with 1 changes to 1 files
160 updating to branch default
160 updating to branch default
161 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
161 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
162 $ cd ../rp
162 $ cd ../rp
163 $ hg transplant -s http://localhost:$HGPORT/ 2 4
163 $ hg transplant -s http://localhost:$HGPORT/ 2 4
164 searching for changes
164 searching for changes
165 searching for changes
165 searching for changes
166 adding changesets
166 adding changesets
167 adding manifests
167 adding manifests
168 adding file changes
168 adding file changes
169 added 1 changesets with 1 changes to 1 files
169 added 1 changesets with 1 changes to 1 files
170 applying a53251cdf717
170 applying a53251cdf717
171 a53251cdf717 transplanted to 8d9279348abb
171 a53251cdf717 transplanted to 8d9279348abb
172 $ hg log --template '{rev} {parents} {desc}\n'
172 $ hg log --template '{rev} {parents} {desc}\n'
173 2 b3
173 2 b3
174 1 b1
174 1 b1
175 0 r1
175 0 r1
176
176
177 transplant --continue
177 transplant --continue
178
178
179 $ hg init ../tc
179 $ hg init ../tc
180 $ cd ../tc
180 $ cd ../tc
181 $ cat <<EOF > foo
181 $ cat <<EOF > foo
182 > foo
182 > foo
183 > bar
183 > bar
184 > baz
184 > baz
185 > EOF
185 > EOF
186 $ echo toremove > toremove
186 $ echo toremove > toremove
187 $ hg ci -Amfoo
187 $ hg ci -Amfoo
188 adding foo
188 adding foo
189 adding toremove
189 adding toremove
190 $ cat <<EOF > foo
190 $ cat <<EOF > foo
191 > foo2
191 > foo2
192 > bar2
192 > bar2
193 > baz2
193 > baz2
194 > EOF
194 > EOF
195 $ rm toremove
195 $ rm toremove
196 $ echo added > added
196 $ echo added > added
197 $ hg ci -Amfoo2
197 $ hg ci -Amfoo2
198 adding added
198 adding added
199 removing toremove
199 removing toremove
200 $ echo bar > bar
200 $ echo bar > bar
201 $ hg ci -Ambar
201 $ hg ci -Ambar
202 adding bar
202 adding bar
203 $ echo bar2 >> bar
203 $ echo bar2 >> bar
204 $ hg ci -mbar2
204 $ hg ci -mbar2
205 $ hg up 0
205 $ hg up 0
206 2 files updated, 0 files merged, 2 files removed, 0 files unresolved
206 2 files updated, 0 files merged, 2 files removed, 0 files unresolved
207 $ echo foobar > foo
207 $ echo foobar > foo
208 $ hg ci -mfoobar
208 $ hg ci -mfoobar
209 created new head
209 created new head
210 $ hg transplant 1:3
210 $ hg transplant 1:3
211 applying a1e30dd1b8e7
211 applying a1e30dd1b8e7
212 patching file foo
212 patching file foo
213 Hunk #1 FAILED at 0
213 Hunk #1 FAILED at 0
214 1 out of 1 hunks FAILED -- saving rejects to file foo.rej
214 1 out of 1 hunks FAILED -- saving rejects to file foo.rej
215 patch failed to apply
215 patch failed to apply
216 abort: fix up the merge and run hg transplant --continue
216 abort: fix up the merge and run hg transplant --continue
217 [255]
217 [255]
218
218
219 transplant -c shouldn't use an old changeset
219 transplant -c shouldn't use an old changeset
220
220
221 $ hg up -C
221 $ hg up -C
222 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
222 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
223 $ rm added
223 $ rm added
224 $ hg transplant 1
224 $ hg transplant 1
225 applying a1e30dd1b8e7
225 applying a1e30dd1b8e7
226 patching file foo
226 patching file foo
227 Hunk #1 FAILED at 0
227 Hunk #1 FAILED at 0
228 1 out of 1 hunks FAILED -- saving rejects to file foo.rej
228 1 out of 1 hunks FAILED -- saving rejects to file foo.rej
229 patch failed to apply
229 patch failed to apply
230 abort: fix up the merge and run hg transplant --continue
230 abort: fix up the merge and run hg transplant --continue
231 [255]
231 [255]
232 $ hg transplant --continue
232 $ hg transplant --continue
233 a1e30dd1b8e7 transplanted as f1563cf27039
233 a1e30dd1b8e7 transplanted as f1563cf27039
234 $ hg transplant 1:3
234 $ hg transplant 1:3
235 skipping already applied revision 1:a1e30dd1b8e7
235 skipping already applied revision 1:a1e30dd1b8e7
236 applying 1739ac5f6139
236 applying 1739ac5f6139
237 1739ac5f6139 transplanted to d649c221319f
237 1739ac5f6139 transplanted to d649c221319f
238 applying 0282d5fbbe02
238 applying 0282d5fbbe02
239 0282d5fbbe02 transplanted to 77418277ccb3
239 0282d5fbbe02 transplanted to 77418277ccb3
240 $ hg locate
240 $ hg locate
241 added
241 added
242 bar
242 bar
243 foo
243 foo
244 $ cd ..
244 $ cd ..
245
245
246 Issue1111: Test transplant --merge
246 Issue1111: Test transplant --merge
247
247
248 $ hg init t1111
248 $ hg init t1111
249 $ cd t1111
249 $ cd t1111
250 $ echo a > a
250 $ echo a > a
251 $ hg ci -Am adda
251 $ hg ci -Am adda
252 adding a
252 adding a
253 $ echo b >> a
253 $ echo b >> a
254 $ hg ci -m appendb
254 $ hg ci -m appendb
255 $ echo c >> a
255 $ echo c >> a
256 $ hg ci -m appendc
256 $ hg ci -m appendc
257 $ hg up -C 0
257 $ hg up -C 0
258 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
258 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
259 $ echo d >> a
259 $ echo d >> a
260 $ hg ci -m appendd
260 $ hg ci -m appendd
261 created new head
261 created new head
262
262
263 tranplant
263 tranplant
264
264
265 $ hg transplant -m 1
265 $ hg transplant -m 1
266 applying 42dc4432fd35
266 applying 42dc4432fd35
267 1:42dc4432fd35 merged at a9f4acbac129
267 1:42dc4432fd35 merged at a9f4acbac129
268 $ cd ..
268 $ cd ..
269
269
270 test transplant into empty repository
270 test transplant into empty repository
271
271
272 $ hg init empty
272 $ hg init empty
273 $ cd empty
273 $ cd empty
274 $ hg transplant -s ../t -b tip -a
274 $ hg transplant -s ../t -b tip -a
275 adding changesets
275 adding changesets
276 adding manifests
276 adding manifests
277 adding file changes
277 adding file changes
278 added 4 changesets with 4 changes to 4 files
278 added 4 changesets with 4 changes to 4 files
279 $ cd ..
279 $ cd ..
280
280
281
281
282 test filter
282 test filter
283
283
284 $ hg init filter
284 $ hg init filter
285 $ cd filter
285 $ cd filter
286 $ cat <<'EOF' >test-filter
286 $ cat <<'EOF' >test-filter
287 > #!/bin/sh
287 > #!/bin/sh
288 > sed 's/r1/r2/' $1 > $1.new
288 > sed 's/r1/r2/' $1 > $1.new
289 > mv $1.new $1
289 > mv $1.new $1
290 > EOF
290 > EOF
291 $ chmod +x test-filter
291 $ chmod +x test-filter
292 $ hg transplant -s ../t -b tip -a --filter ./test-filter
292 $ hg transplant -s ../t -b tip -a --filter ./test-filter
293 filtering * (glob)
293 filtering * (glob)
294 applying 17ab29e464c6
294 applying 17ab29e464c6
295 17ab29e464c6 transplanted to e9ffc54ea104
295 17ab29e464c6 transplanted to e9ffc54ea104
296 filtering * (glob)
296 filtering * (glob)
297 applying 37a1297eb21b
297 applying 37a1297eb21b
298 37a1297eb21b transplanted to 348b36d0b6a5
298 37a1297eb21b transplanted to 348b36d0b6a5
299 filtering * (glob)
299 filtering * (glob)
300 applying 722f4667af76
300 applying 722f4667af76
301 722f4667af76 transplanted to 0aa6979afb95
301 722f4667af76 transplanted to 0aa6979afb95
302 filtering * (glob)
302 filtering * (glob)
303 applying a53251cdf717
303 applying a53251cdf717
304 a53251cdf717 transplanted to 14f8512272b5
304 a53251cdf717 transplanted to 14f8512272b5
305 $ hg log --template '{rev} {parents} {desc}\n'
305 $ hg log --template '{rev} {parents} {desc}\n'
306 3 b3
306 3 b3
307 2 b2
307 2 b2
308 1 b1
308 1 b1
309 0 r2
309 0 r2
310 $ cd ..
310 $ cd ..
311
311
312
312
313 test filter with failed patch
313 test filter with failed patch
314
314
315 $ cd filter
315 $ cd filter
316 $ hg up 0
316 $ hg up 0
317 0 files updated, 0 files merged, 3 files removed, 0 files unresolved
317 0 files updated, 0 files merged, 3 files removed, 0 files unresolved
318 $ echo foo > b1
318 $ echo foo > b1
319 $ hg ci -Am foo
319 $ hg ci -Am foo
320 adding b1
320 adding b1
321 adding test-filter
321 adding test-filter
322 created new head
322 created new head
323 $ hg transplant 1 --filter ./test-filter
323 $ hg transplant 1 --filter ./test-filter
324 filtering * (glob)
324 filtering * (glob)
325 applying 348b36d0b6a5
325 applying 348b36d0b6a5
326 file b1 already exists
326 file b1 already exists
327 1 out of 1 hunks FAILED -- saving rejects to file b1.rej
327 1 out of 1 hunks FAILED -- saving rejects to file b1.rej
328 patch failed to apply
328 patch failed to apply
329 abort: fix up the merge and run hg transplant --continue
329 abort: fix up the merge and run hg transplant --continue
330 [255]
330 [255]
331 $ cd ..
331 $ cd ..
332
332
333
333
334 test with a win32ext like setup (differing EOLs)
334 test with a win32ext like setup (differing EOLs)
335
335
336 $ hg init twin1
336 $ hg init twin1
337 $ cd twin1
337 $ cd twin1
338 $ echo a > a
338 $ echo a > a
339 $ echo b > b
339 $ echo b > b
340 $ echo b >> b
340 $ echo b >> b
341 $ hg ci -Am t
341 $ hg ci -Am t
342 adding a
342 adding a
343 adding b
343 adding b
344 $ echo a > b
344 $ echo a > b
345 $ echo b >> b
345 $ echo b >> b
346 $ hg ci -m changeb
346 $ hg ci -m changeb
347 $ cd ..
347 $ cd ..
348
348
349 $ hg init twin2
349 $ hg init twin2
350 $ cd twin2
350 $ cd twin2
351 $ echo '[patch]' >> .hg/hgrc
351 $ echo '[patch]' >> .hg/hgrc
352 $ echo 'eol = crlf' >> .hg/hgrc
352 $ echo 'eol = crlf' >> .hg/hgrc
353 $ python -c "file('b', 'wb').write('b\r\nb\r\n')"
353 $ python -c "file('b', 'wb').write('b\r\nb\r\n')"
354 $ hg ci -m addb
354 $ hg ci -Am addb
355 nothing changed
355 adding b
356 [1]
357 $ hg transplant -s ../twin1 tip
356 $ hg transplant -s ../twin1 tip
357 searching for changes
358 warning: repository is unrelated
358 applying 2e849d776c17
359 applying 2e849d776c17
359 2e849d776c17 transplanted to 589cea8ba85b
360 2e849d776c17 transplanted to 8e65bebc063e
360 $ cat b
361 $ cat b
361 a\r (esc)
362 a\r (esc)
362 b\r (esc)
363 b\r (esc)
363 $ cd ..
364 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now