Show More
@@ -1,721 +1,721 b'' | |||
|
1 | 1 | Create a repo with some stuff in it: |
|
2 | 2 | |
|
3 | 3 | $ hg init a |
|
4 | 4 | $ cd a |
|
5 | 5 | $ echo a > a |
|
6 | 6 | $ echo a > d |
|
7 | 7 | $ echo a > e |
|
8 | 8 | $ hg ci -qAm0 |
|
9 | 9 | $ echo b > a |
|
10 | 10 | $ hg ci -m1 -u bar |
|
11 | 11 | $ hg mv a b |
|
12 | 12 | $ hg ci -m2 |
|
13 | 13 | $ hg cp b c |
|
14 | 14 | $ hg ci -m3 -u baz |
|
15 | 15 | $ echo b > d |
|
16 | 16 | $ echo f > e |
|
17 | 17 | $ hg ci -m4 |
|
18 | 18 | $ hg up -q 3 |
|
19 | 19 | $ echo b > e |
|
20 | 20 | $ hg branch -q stable |
|
21 | 21 | $ hg ci -m5 |
|
22 | 22 | $ hg merge -q default --tool internal:local |
|
23 | 23 | $ hg branch -q default |
|
24 | 24 | $ hg ci -m6 |
|
25 | 25 | $ hg phase --public 3 |
|
26 | 26 | $ hg phase --force --secret 6 |
|
27 | 27 | |
|
28 | 28 | $ hg log -G --template '{author}@{rev}.{phase}: {desc}\n' |
|
29 | 29 | @ test@6.secret: 6 |
|
30 | 30 | |\ |
|
31 | 31 | | o test@5.draft: 5 |
|
32 | 32 | | | |
|
33 | 33 | o | test@4.draft: 4 |
|
34 | 34 | |/ |
|
35 | 35 | o baz@3.public: 3 |
|
36 | 36 | | |
|
37 | 37 | o test@2.public: 2 |
|
38 | 38 | | |
|
39 | 39 | o bar@1.public: 1 |
|
40 | 40 | | |
|
41 | 41 | o test@0.public: 0 |
|
42 | 42 | |
|
43 | 43 | |
|
44 | 44 | Need to specify a rev: |
|
45 | 45 | |
|
46 | 46 | $ hg graft |
|
47 | 47 | abort: no revisions specified |
|
48 | 48 | [255] |
|
49 | 49 | |
|
50 | 50 | Can't graft ancestor: |
|
51 | 51 | |
|
52 | 52 | $ hg graft 1 2 |
|
53 | 53 | skipping ancestor revision 1:5d205f8b35b6 |
|
54 | 54 | skipping ancestor revision 2:5c095ad7e90f |
|
55 | 55 | [255] |
|
56 | 56 | |
|
57 | 57 | Specify revisions with -r: |
|
58 | 58 | |
|
59 | 59 | $ hg graft -r 1 -r 2 |
|
60 | 60 | skipping ancestor revision 1:5d205f8b35b6 |
|
61 | 61 | skipping ancestor revision 2:5c095ad7e90f |
|
62 | 62 | [255] |
|
63 | 63 | |
|
64 | 64 | $ hg graft -r 1 2 |
|
65 | 65 | skipping ancestor revision 2:5c095ad7e90f |
|
66 | 66 | skipping ancestor revision 1:5d205f8b35b6 |
|
67 | 67 | [255] |
|
68 | 68 | |
|
69 | 69 | Can't graft with dirty wd: |
|
70 | 70 | |
|
71 | 71 | $ hg up -q 0 |
|
72 | 72 | $ echo foo > a |
|
73 | 73 | $ hg graft 1 |
|
74 | 74 | abort: uncommitted changes |
|
75 | 75 | [255] |
|
76 | 76 | $ hg revert a |
|
77 | 77 | |
|
78 | 78 | Graft a rename: |
|
79 | 79 | (this also tests that editor is invoked if '--edit' is specified) |
|
80 | 80 | |
|
81 | 81 | $ hg status --rev "2^1" --rev 2 |
|
82 | 82 | A b |
|
83 | 83 | R a |
|
84 | 84 | $ HGEDITOR=cat hg graft 2 -u foo --edit |
|
85 | 85 | grafting 2:5c095ad7e90f "2" |
|
86 | 86 | merging a and b to b |
|
87 | 87 | 2 |
|
88 | 88 | |
|
89 | 89 | |
|
90 | 90 | HG: Enter commit message. Lines beginning with 'HG:' are removed. |
|
91 | 91 | HG: Leave message empty to abort commit. |
|
92 | 92 | HG: -- |
|
93 | 93 | HG: user: foo |
|
94 | 94 | HG: branch 'default' |
|
95 | 95 | HG: added b |
|
96 | 96 | HG: removed a |
|
97 | 97 | $ hg export tip --git |
|
98 | 98 | # HG changeset patch |
|
99 | 99 | # User foo |
|
100 | 100 | # Date 0 0 |
|
101 | 101 | # Thu Jan 01 00:00:00 1970 +0000 |
|
102 | 102 | # Node ID ef0ef43d49e79e81ddafdc7997401ba0041efc82 |
|
103 | 103 | # Parent 68795b066622ca79a25816a662041d8f78f3cd9e |
|
104 | 104 | 2 |
|
105 | 105 | |
|
106 | 106 | diff --git a/a b/b |
|
107 | 107 | rename from a |
|
108 | 108 | rename to b |
|
109 | 109 | |
|
110 | 110 | Look for extra:source |
|
111 | 111 | |
|
112 | 112 | $ hg log --debug -r tip |
|
113 | 113 | changeset: 7:ef0ef43d49e79e81ddafdc7997401ba0041efc82 |
|
114 | 114 | tag: tip |
|
115 | 115 | phase: draft |
|
116 | 116 | parent: 0:68795b066622ca79a25816a662041d8f78f3cd9e |
|
117 | 117 | parent: -1:0000000000000000000000000000000000000000 |
|
118 | 118 | manifest: 7:e59b6b228f9cbf9903d5e9abf996e083a1f533eb |
|
119 | 119 | user: foo |
|
120 | 120 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
121 | 121 | files+: b |
|
122 | 122 | files-: a |
|
123 | 123 | extra: branch=default |
|
124 | 124 | extra: source=5c095ad7e90f871700f02dd1fa5012cb4498a2d4 |
|
125 | 125 | description: |
|
126 | 126 | 2 |
|
127 | 127 | |
|
128 | 128 | |
|
129 | 129 | |
|
130 | 130 | Graft out of order, skipping a merge and a duplicate |
|
131 | 131 | (this also tests that editor is not invoked if '--edit' is not specified) |
|
132 | 132 | |
|
133 | 133 | $ hg graft 1 5 4 3 'merge()' 2 -n |
|
134 | 134 | skipping ungraftable merge revision 6 |
|
135 | 135 | skipping revision 2:5c095ad7e90f (already grafted to 7:ef0ef43d49e7) |
|
136 | 136 | grafting 1:5d205f8b35b6 "1" |
|
137 | 137 | grafting 5:97f8bfe72746 "5" |
|
138 | 138 | grafting 4:9c233e8e184d "4" |
|
139 | 139 | grafting 3:4c60f11aa304 "3" |
|
140 | 140 | |
|
141 | 141 | $ HGEDITOR=cat hg graft 1 5 4 3 'merge()' 2 --debug |
|
142 | 142 | skipping ungraftable merge revision 6 |
|
143 | 143 | scanning for duplicate grafts |
|
144 | 144 | skipping revision 2:5c095ad7e90f (already grafted to 7:ef0ef43d49e7) |
|
145 | 145 | grafting 1:5d205f8b35b6 "1" |
|
146 | 146 | searching for copies back to rev 1 |
|
147 | 147 | unmatched files in local: |
|
148 | 148 | b |
|
149 | 149 | all copies found (* = to merge, ! = divergent, % = renamed and deleted): |
|
150 | 150 | src: 'a' -> dst: 'b' * |
|
151 | 151 | checking for directory renames |
|
152 | 152 | resolving manifests |
|
153 | 153 | branchmerge: True, force: True, partial: False |
|
154 | 154 | ancestor: 68795b066622, local: ef0ef43d49e7+, remote: 5d205f8b35b6 |
|
155 | 155 | preserving b for resolve of b |
|
156 | 156 | b: local copied/moved from a -> m |
|
157 | 157 | updating: b 1/1 files (100.00%) |
|
158 | 158 | picked tool 'internal:merge' for b (binary False symlink False) |
|
159 | 159 | merging b and a to b |
|
160 | 160 | my b@ef0ef43d49e7+ other a@5d205f8b35b6 ancestor a@68795b066622 |
|
161 | 161 | premerge successful |
|
162 | 162 | b |
|
163 | 163 | grafting 5:97f8bfe72746 "5" |
|
164 | 164 | searching for copies back to rev 1 |
|
165 | 165 | resolving manifests |
|
166 | 166 | branchmerge: True, force: True, partial: False |
|
167 | 167 | ancestor: 4c60f11aa304, local: 6b9e5368ca4e+, remote: 97f8bfe72746 |
|
168 | 168 | e: remote is newer -> g |
|
169 | 169 | getting e |
|
170 | 170 | updating: e 1/1 files (100.00%) |
|
171 | 171 | b: remote unchanged -> k |
|
172 | 172 | e |
|
173 | 173 | grafting 4:9c233e8e184d "4" |
|
174 | 174 | searching for copies back to rev 1 |
|
175 | 175 | resolving manifests |
|
176 | 176 | branchmerge: True, force: True, partial: False |
|
177 | 177 | ancestor: 4c60f11aa304, local: 1905859650ec+, remote: 9c233e8e184d |
|
178 | 178 | preserving e for resolve of e |
|
179 | 179 | d: remote is newer -> g |
|
180 | 180 | getting d |
|
181 | 181 | updating: d 1/2 files (50.00%) |
|
182 | 182 | b: remote unchanged -> k |
|
183 | 183 | e: versions differ -> m |
|
184 | 184 | updating: e 2/2 files (100.00%) |
|
185 | 185 | picked tool 'internal:merge' for e (binary False symlink False) |
|
186 | 186 | merging e |
|
187 | 187 | my e@1905859650ec+ other e@9c233e8e184d ancestor e@68795b066622 |
|
188 | 188 | warning: conflicts during merge. |
|
189 | 189 | merging e incomplete! (edit conflicts, then use 'hg resolve --mark') |
|
190 | 190 | abort: unresolved conflicts, can't continue |
|
191 | 191 | (use hg resolve and hg graft --continue) |
|
192 | 192 | [255] |
|
193 | 193 | |
|
194 | 194 | Commit while interrupted should fail: |
|
195 | 195 | |
|
196 | 196 | $ hg ci -m 'commit interrupted graft' |
|
197 | 197 | abort: graft in progress |
|
198 | 198 | (use 'hg graft --continue' or 'hg update' to abort) |
|
199 | 199 | [255] |
|
200 | 200 | |
|
201 | 201 | Abort the graft and try committing: |
|
202 | 202 | |
|
203 | 203 | $ hg up -C . |
|
204 | 204 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
205 | 205 | $ echo c >> e |
|
206 | 206 | $ hg ci -mtest |
|
207 | 207 | |
|
208 |
$ hg strip . --config extensions. |
|
|
208 | $ hg strip . --config extensions.strip= | |
|
209 | 209 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
210 | 210 | saved backup bundle to $TESTTMP/a/.hg/strip-backup/*-backup.hg (glob) |
|
211 | 211 | |
|
212 | 212 | Graft again: |
|
213 | 213 | |
|
214 | 214 | $ hg graft 1 5 4 3 'merge()' 2 |
|
215 | 215 | skipping ungraftable merge revision 6 |
|
216 | 216 | skipping revision 2:5c095ad7e90f (already grafted to 7:ef0ef43d49e7) |
|
217 | 217 | skipping revision 1:5d205f8b35b6 (already grafted to 8:6b9e5368ca4e) |
|
218 | 218 | skipping revision 5:97f8bfe72746 (already grafted to 9:1905859650ec) |
|
219 | 219 | grafting 4:9c233e8e184d "4" |
|
220 | 220 | merging e |
|
221 | 221 | warning: conflicts during merge. |
|
222 | 222 | merging e incomplete! (edit conflicts, then use 'hg resolve --mark') |
|
223 | 223 | abort: unresolved conflicts, can't continue |
|
224 | 224 | (use hg resolve and hg graft --continue) |
|
225 | 225 | [255] |
|
226 | 226 | |
|
227 | 227 | Continue without resolve should fail: |
|
228 | 228 | |
|
229 | 229 | $ hg graft -c |
|
230 | 230 | grafting 4:9c233e8e184d "4" |
|
231 | 231 | abort: unresolved merge conflicts (see hg help resolve) |
|
232 | 232 | [255] |
|
233 | 233 | |
|
234 | 234 | Fix up: |
|
235 | 235 | |
|
236 | 236 | $ echo b > e |
|
237 | 237 | $ hg resolve -m e |
|
238 | 238 | (no more unresolved files) |
|
239 | 239 | |
|
240 | 240 | Continue with a revision should fail: |
|
241 | 241 | |
|
242 | 242 | $ hg graft -c 6 |
|
243 | 243 | abort: can't specify --continue and revisions |
|
244 | 244 | [255] |
|
245 | 245 | |
|
246 | 246 | $ hg graft -c -r 6 |
|
247 | 247 | abort: can't specify --continue and revisions |
|
248 | 248 | [255] |
|
249 | 249 | |
|
250 | 250 | Continue for real, clobber usernames |
|
251 | 251 | |
|
252 | 252 | $ hg graft -c -U |
|
253 | 253 | grafting 4:9c233e8e184d "4" |
|
254 | 254 | grafting 3:4c60f11aa304 "3" |
|
255 | 255 | |
|
256 | 256 | Compare with original: |
|
257 | 257 | |
|
258 | 258 | $ hg diff -r 6 |
|
259 | 259 | $ hg status --rev 0:. -C |
|
260 | 260 | M d |
|
261 | 261 | M e |
|
262 | 262 | A b |
|
263 | 263 | a |
|
264 | 264 | A c |
|
265 | 265 | a |
|
266 | 266 | R a |
|
267 | 267 | |
|
268 | 268 | View graph: |
|
269 | 269 | |
|
270 | 270 | $ hg log -G --template '{author}@{rev}.{phase}: {desc}\n' |
|
271 | 271 | @ test@11.draft: 3 |
|
272 | 272 | | |
|
273 | 273 | o test@10.draft: 4 |
|
274 | 274 | | |
|
275 | 275 | o test@9.draft: 5 |
|
276 | 276 | | |
|
277 | 277 | o bar@8.draft: 1 |
|
278 | 278 | | |
|
279 | 279 | o foo@7.draft: 2 |
|
280 | 280 | | |
|
281 | 281 | | o test@6.secret: 6 |
|
282 | 282 | | |\ |
|
283 | 283 | | | o test@5.draft: 5 |
|
284 | 284 | | | | |
|
285 | 285 | | o | test@4.draft: 4 |
|
286 | 286 | | |/ |
|
287 | 287 | | o baz@3.public: 3 |
|
288 | 288 | | | |
|
289 | 289 | | o test@2.public: 2 |
|
290 | 290 | | | |
|
291 | 291 | | o bar@1.public: 1 |
|
292 | 292 | |/ |
|
293 | 293 | o test@0.public: 0 |
|
294 | 294 | |
|
295 | 295 | Graft again onto another branch should preserve the original source |
|
296 | 296 | $ hg up -q 0 |
|
297 | 297 | $ echo 'g'>g |
|
298 | 298 | $ hg add g |
|
299 | 299 | $ hg ci -m 7 |
|
300 | 300 | created new head |
|
301 | 301 | $ hg graft 7 |
|
302 | 302 | grafting 7:ef0ef43d49e7 "2" |
|
303 | 303 | |
|
304 | 304 | $ hg log -r 7 --template '{rev}:{node}\n' |
|
305 | 305 | 7:ef0ef43d49e79e81ddafdc7997401ba0041efc82 |
|
306 | 306 | $ hg log -r 2 --template '{rev}:{node}\n' |
|
307 | 307 | 2:5c095ad7e90f871700f02dd1fa5012cb4498a2d4 |
|
308 | 308 | |
|
309 | 309 | $ hg log --debug -r tip |
|
310 | 310 | changeset: 13:9db0f28fd3747e92c57d015f53b5593aeec53c2d |
|
311 | 311 | tag: tip |
|
312 | 312 | phase: draft |
|
313 | 313 | parent: 12:b592ea63bb0c19a6c5c44685ee29a2284f9f1b8f |
|
314 | 314 | parent: -1:0000000000000000000000000000000000000000 |
|
315 | 315 | manifest: 13:dc313617b8c32457c0d589e0dbbedfe71f3cd637 |
|
316 | 316 | user: foo |
|
317 | 317 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
318 | 318 | files+: b |
|
319 | 319 | files-: a |
|
320 | 320 | extra: branch=default |
|
321 | 321 | extra: source=5c095ad7e90f871700f02dd1fa5012cb4498a2d4 |
|
322 | 322 | description: |
|
323 | 323 | 2 |
|
324 | 324 | |
|
325 | 325 | |
|
326 | 326 | Disallow grafting an already grafted cset onto its original branch |
|
327 | 327 | $ hg up -q 6 |
|
328 | 328 | $ hg graft 7 |
|
329 | 329 | skipping already grafted revision 7:ef0ef43d49e7 (was grafted from 2:5c095ad7e90f) |
|
330 | 330 | [255] |
|
331 | 331 | |
|
332 | 332 | Disallow grafting already grafted csets with the same origin onto each other |
|
333 | 333 | $ hg up -q 13 |
|
334 | 334 | $ hg graft 2 |
|
335 | 335 | skipping revision 2:5c095ad7e90f (already grafted to 13:9db0f28fd374) |
|
336 | 336 | [255] |
|
337 | 337 | $ hg graft 7 |
|
338 | 338 | skipping already grafted revision 7:ef0ef43d49e7 (13:9db0f28fd374 also has origin 2:5c095ad7e90f) |
|
339 | 339 | [255] |
|
340 | 340 | |
|
341 | 341 | $ hg up -q 7 |
|
342 | 342 | $ hg graft 2 |
|
343 | 343 | skipping revision 2:5c095ad7e90f (already grafted to 7:ef0ef43d49e7) |
|
344 | 344 | [255] |
|
345 | 345 | $ hg graft tip |
|
346 | 346 | skipping already grafted revision 13:9db0f28fd374 (7:ef0ef43d49e7 also has origin 2:5c095ad7e90f) |
|
347 | 347 | [255] |
|
348 | 348 | |
|
349 | 349 | Graft with --log |
|
350 | 350 | |
|
351 | 351 | $ hg up -Cq 1 |
|
352 | 352 | $ hg graft 3 --log -u foo |
|
353 | 353 | grafting 3:4c60f11aa304 "3" |
|
354 | 354 | warning: can't find ancestor for 'c' copied from 'b'! |
|
355 | 355 | $ hg log --template '{rev} {parents} {desc}\n' -r tip |
|
356 | 356 | 14 1:5d205f8b35b6 3 |
|
357 | 357 | (grafted from 4c60f11aa304a54ae1c199feb94e7fc771e51ed8) |
|
358 | 358 | |
|
359 | 359 | Resolve conflicted graft |
|
360 | 360 | $ hg up -q 0 |
|
361 | 361 | $ echo b > a |
|
362 | 362 | $ hg ci -m 8 |
|
363 | 363 | created new head |
|
364 | 364 | $ echo c > a |
|
365 | 365 | $ hg ci -m 9 |
|
366 | 366 | $ hg graft 1 --tool internal:fail |
|
367 | 367 | grafting 1:5d205f8b35b6 "1" |
|
368 | 368 | abort: unresolved conflicts, can't continue |
|
369 | 369 | (use hg resolve and hg graft --continue) |
|
370 | 370 | [255] |
|
371 | 371 | $ hg resolve --all |
|
372 | 372 | merging a |
|
373 | 373 | warning: conflicts during merge. |
|
374 | 374 | merging a incomplete! (edit conflicts, then use 'hg resolve --mark') |
|
375 | 375 | [1] |
|
376 | 376 | $ cat a |
|
377 | 377 | <<<<<<< local: aaa4406d4f0a - test: 9 |
|
378 | 378 | c |
|
379 | 379 | ======= |
|
380 | 380 | b |
|
381 | 381 | >>>>>>> other: 5d205f8b35b6 - bar: 1 |
|
382 | 382 | $ echo b > a |
|
383 | 383 | $ hg resolve -m a |
|
384 | 384 | (no more unresolved files) |
|
385 | 385 | $ hg graft -c |
|
386 | 386 | grafting 1:5d205f8b35b6 "1" |
|
387 | 387 | $ hg export tip --git |
|
388 | 388 | # HG changeset patch |
|
389 | 389 | # User bar |
|
390 | 390 | # Date 0 0 |
|
391 | 391 | # Thu Jan 01 00:00:00 1970 +0000 |
|
392 | 392 | # Node ID f67661df0c4804d301f064f332b57e7d5ddaf2be |
|
393 | 393 | # Parent aaa4406d4f0ae9befd6e58c82ec63706460cbca6 |
|
394 | 394 | 1 |
|
395 | 395 | |
|
396 | 396 | diff --git a/a b/a |
|
397 | 397 | --- a/a |
|
398 | 398 | +++ b/a |
|
399 | 399 | @@ -1,1 +1,1 @@ |
|
400 | 400 | -c |
|
401 | 401 | +b |
|
402 | 402 | |
|
403 | 403 | Resolve conflicted graft with rename |
|
404 | 404 | $ echo c > a |
|
405 | 405 | $ hg ci -m 10 |
|
406 | 406 | $ hg graft 2 --tool internal:fail |
|
407 | 407 | grafting 2:5c095ad7e90f "2" |
|
408 | 408 | abort: unresolved conflicts, can't continue |
|
409 | 409 | (use hg resolve and hg graft --continue) |
|
410 | 410 | [255] |
|
411 | 411 | $ hg resolve --all |
|
412 | 412 | merging a and b to b |
|
413 | 413 | (no more unresolved files) |
|
414 | 414 | $ hg graft -c |
|
415 | 415 | grafting 2:5c095ad7e90f "2" |
|
416 | 416 | $ hg export tip --git |
|
417 | 417 | # HG changeset patch |
|
418 | 418 | # User test |
|
419 | 419 | # Date 0 0 |
|
420 | 420 | # Thu Jan 01 00:00:00 1970 +0000 |
|
421 | 421 | # Node ID 9627f653b421c61fc1ea4c4e366745070fa3d2bc |
|
422 | 422 | # Parent ee295f490a40b97f3d18dd4c4f1c8936c233b612 |
|
423 | 423 | 2 |
|
424 | 424 | |
|
425 | 425 | diff --git a/a b/b |
|
426 | 426 | rename from a |
|
427 | 427 | rename to b |
|
428 | 428 | |
|
429 | 429 | Test simple origin(), with and without args |
|
430 | 430 | $ hg log -r 'origin()' |
|
431 | 431 | changeset: 1:5d205f8b35b6 |
|
432 | 432 | user: bar |
|
433 | 433 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
434 | 434 | summary: 1 |
|
435 | 435 | |
|
436 | 436 | changeset: 2:5c095ad7e90f |
|
437 | 437 | user: test |
|
438 | 438 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
439 | 439 | summary: 2 |
|
440 | 440 | |
|
441 | 441 | changeset: 3:4c60f11aa304 |
|
442 | 442 | user: baz |
|
443 | 443 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
444 | 444 | summary: 3 |
|
445 | 445 | |
|
446 | 446 | changeset: 4:9c233e8e184d |
|
447 | 447 | user: test |
|
448 | 448 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
449 | 449 | summary: 4 |
|
450 | 450 | |
|
451 | 451 | changeset: 5:97f8bfe72746 |
|
452 | 452 | branch: stable |
|
453 | 453 | parent: 3:4c60f11aa304 |
|
454 | 454 | user: test |
|
455 | 455 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
456 | 456 | summary: 5 |
|
457 | 457 | |
|
458 | 458 | $ hg log -r 'origin(7)' |
|
459 | 459 | changeset: 2:5c095ad7e90f |
|
460 | 460 | user: test |
|
461 | 461 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
462 | 462 | summary: 2 |
|
463 | 463 | |
|
464 | 464 | Now transplant a graft to test following through copies |
|
465 | 465 | $ hg up -q 0 |
|
466 | 466 | $ hg branch -q dev |
|
467 | 467 | $ hg ci -qm "dev branch" |
|
468 | 468 | $ hg --config extensions.transplant= transplant -q 7 |
|
469 | 469 | $ hg log -r 'origin(.)' |
|
470 | 470 | changeset: 2:5c095ad7e90f |
|
471 | 471 | user: test |
|
472 | 472 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
473 | 473 | summary: 2 |
|
474 | 474 | |
|
475 | 475 | Test that the graft and transplant markers in extra are converted, allowing |
|
476 | 476 | origin() to still work. Note that these recheck the immediately preceeding two |
|
477 | 477 | tests. |
|
478 | 478 | $ hg --quiet --config extensions.convert= --config convert.hg.saverev=True convert . ../converted |
|
479 | 479 | |
|
480 | 480 | The graft case |
|
481 | 481 | $ hg -R ../converted log -r 7 --template "{rev}: {node}\n{join(extras, '\n')}\n" |
|
482 | 482 | 7: 7ae846e9111fc8f57745634250c7b9ac0a60689b |
|
483 | 483 | branch=default |
|
484 | 484 | convert_revision=ef0ef43d49e79e81ddafdc7997401ba0041efc82 |
|
485 | 485 | source=e0213322b2c1a5d5d236c74e79666441bee67a7d |
|
486 | 486 | $ hg -R ../converted log -r 'origin(7)' |
|
487 | 487 | changeset: 2:e0213322b2c1 |
|
488 | 488 | user: test |
|
489 | 489 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
490 | 490 | summary: 2 |
|
491 | 491 | |
|
492 | 492 | Test that template correctly expands more than one 'extra' (issue4362) |
|
493 | 493 | $ hg -R ../converted log -r 7 --template "{extras % ' Extra: {extra}\n'}" |
|
494 | 494 | Extra: branch=default |
|
495 | 495 | Extra: convert_revision=ef0ef43d49e79e81ddafdc7997401ba0041efc82 |
|
496 | 496 | Extra: source=e0213322b2c1a5d5d236c74e79666441bee67a7d |
|
497 | 497 | |
|
498 | 498 | The transplant case |
|
499 | 499 | $ hg -R ../converted log -r tip --template "{rev}: {node}\n{join(extras, '\n')}\n" |
|
500 | 500 | 21: fbb6c5cc81002f2b4b49c9d731404688bcae5ade |
|
501 | 501 | branch=dev |
|
502 | 502 | convert_revision=7e61b508e709a11d28194a5359bc3532d910af21 |
|
503 | 503 | transplant_source=z\xe8F\xe9\x11\x1f\xc8\xf5wEcBP\xc7\xb9\xac (esc) |
|
504 | 504 | `h\x9b (esc) |
|
505 | 505 | $ hg -R ../converted log -r 'origin(tip)' |
|
506 | 506 | changeset: 2:e0213322b2c1 |
|
507 | 507 | user: test |
|
508 | 508 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
509 | 509 | summary: 2 |
|
510 | 510 | |
|
511 | 511 | |
|
512 | 512 | Test simple destination |
|
513 | 513 | $ hg log -r 'destination()' |
|
514 | 514 | changeset: 7:ef0ef43d49e7 |
|
515 | 515 | parent: 0:68795b066622 |
|
516 | 516 | user: foo |
|
517 | 517 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
518 | 518 | summary: 2 |
|
519 | 519 | |
|
520 | 520 | changeset: 8:6b9e5368ca4e |
|
521 | 521 | user: bar |
|
522 | 522 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
523 | 523 | summary: 1 |
|
524 | 524 | |
|
525 | 525 | changeset: 9:1905859650ec |
|
526 | 526 | user: test |
|
527 | 527 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
528 | 528 | summary: 5 |
|
529 | 529 | |
|
530 | 530 | changeset: 10:52dc0b4c6907 |
|
531 | 531 | user: test |
|
532 | 532 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
533 | 533 | summary: 4 |
|
534 | 534 | |
|
535 | 535 | changeset: 11:882b35362a6b |
|
536 | 536 | user: test |
|
537 | 537 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
538 | 538 | summary: 3 |
|
539 | 539 | |
|
540 | 540 | changeset: 13:9db0f28fd374 |
|
541 | 541 | user: foo |
|
542 | 542 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
543 | 543 | summary: 2 |
|
544 | 544 | |
|
545 | 545 | changeset: 14:f64defefacee |
|
546 | 546 | parent: 1:5d205f8b35b6 |
|
547 | 547 | user: foo |
|
548 | 548 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
549 | 549 | summary: 3 |
|
550 | 550 | |
|
551 | 551 | changeset: 17:f67661df0c48 |
|
552 | 552 | user: bar |
|
553 | 553 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
554 | 554 | summary: 1 |
|
555 | 555 | |
|
556 | 556 | changeset: 19:9627f653b421 |
|
557 | 557 | user: test |
|
558 | 558 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
559 | 559 | summary: 2 |
|
560 | 560 | |
|
561 | 561 | changeset: 21:7e61b508e709 |
|
562 | 562 | branch: dev |
|
563 | 563 | tag: tip |
|
564 | 564 | user: foo |
|
565 | 565 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
566 | 566 | summary: 2 |
|
567 | 567 | |
|
568 | 568 | $ hg log -r 'destination(2)' |
|
569 | 569 | changeset: 7:ef0ef43d49e7 |
|
570 | 570 | parent: 0:68795b066622 |
|
571 | 571 | user: foo |
|
572 | 572 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
573 | 573 | summary: 2 |
|
574 | 574 | |
|
575 | 575 | changeset: 13:9db0f28fd374 |
|
576 | 576 | user: foo |
|
577 | 577 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
578 | 578 | summary: 2 |
|
579 | 579 | |
|
580 | 580 | changeset: 19:9627f653b421 |
|
581 | 581 | user: test |
|
582 | 582 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
583 | 583 | summary: 2 |
|
584 | 584 | |
|
585 | 585 | changeset: 21:7e61b508e709 |
|
586 | 586 | branch: dev |
|
587 | 587 | tag: tip |
|
588 | 588 | user: foo |
|
589 | 589 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
590 | 590 | summary: 2 |
|
591 | 591 | |
|
592 | 592 | Transplants of grafts can find a destination... |
|
593 | 593 | $ hg log -r 'destination(7)' |
|
594 | 594 | changeset: 21:7e61b508e709 |
|
595 | 595 | branch: dev |
|
596 | 596 | tag: tip |
|
597 | 597 | user: foo |
|
598 | 598 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
599 | 599 | summary: 2 |
|
600 | 600 | |
|
601 | 601 | ... grafts of grafts unfortunately can't |
|
602 | 602 | $ hg graft -q 13 |
|
603 | 603 | $ hg log -r 'destination(13)' |
|
604 | 604 | All copies of a cset |
|
605 | 605 | $ hg log -r 'origin(13) or destination(origin(13))' |
|
606 | 606 | changeset: 2:5c095ad7e90f |
|
607 | 607 | user: test |
|
608 | 608 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
609 | 609 | summary: 2 |
|
610 | 610 | |
|
611 | 611 | changeset: 7:ef0ef43d49e7 |
|
612 | 612 | parent: 0:68795b066622 |
|
613 | 613 | user: foo |
|
614 | 614 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
615 | 615 | summary: 2 |
|
616 | 616 | |
|
617 | 617 | changeset: 13:9db0f28fd374 |
|
618 | 618 | user: foo |
|
619 | 619 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
620 | 620 | summary: 2 |
|
621 | 621 | |
|
622 | 622 | changeset: 19:9627f653b421 |
|
623 | 623 | user: test |
|
624 | 624 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
625 | 625 | summary: 2 |
|
626 | 626 | |
|
627 | 627 | changeset: 21:7e61b508e709 |
|
628 | 628 | branch: dev |
|
629 | 629 | user: foo |
|
630 | 630 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
631 | 631 | summary: 2 |
|
632 | 632 | |
|
633 | 633 | changeset: 22:1313d0a825e2 |
|
634 | 634 | branch: dev |
|
635 | 635 | tag: tip |
|
636 | 636 | user: foo |
|
637 | 637 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
638 | 638 | summary: 2 |
|
639 | 639 | |
|
640 | 640 | |
|
641 | 641 | graft works on complex revset |
|
642 | 642 | |
|
643 | 643 | $ hg graft 'origin(13) or destination(origin(13))' |
|
644 | 644 | skipping ancestor revision 21:7e61b508e709 |
|
645 | 645 | skipping ancestor revision 22:1313d0a825e2 |
|
646 | 646 | skipping revision 2:5c095ad7e90f (already grafted to 22:1313d0a825e2) |
|
647 | 647 | grafting 7:ef0ef43d49e7 "2" |
|
648 | 648 | grafting 13:9db0f28fd374 "2" |
|
649 | 649 | grafting 19:9627f653b421 "2" |
|
650 | 650 | merging b |
|
651 | 651 | |
|
652 | 652 | graft with --force (still doesn't graft merges) |
|
653 | 653 | |
|
654 | 654 | $ hg graft 19 0 6 |
|
655 | 655 | skipping ungraftable merge revision 6 |
|
656 | 656 | skipping ancestor revision 0:68795b066622 |
|
657 | 657 | skipping already grafted revision 19:9627f653b421 (22:1313d0a825e2 also has origin 2:5c095ad7e90f) |
|
658 | 658 | [255] |
|
659 | 659 | $ hg graft 19 0 6 --force |
|
660 | 660 | skipping ungraftable merge revision 6 |
|
661 | 661 | grafting 19:9627f653b421 "2" |
|
662 | 662 | merging b |
|
663 | 663 | grafting 0:68795b066622 "0" |
|
664 | 664 | |
|
665 | 665 | graft --force after backout |
|
666 | 666 | |
|
667 | 667 | $ echo abc > a |
|
668 | 668 | $ hg ci -m 28 |
|
669 | 669 | $ hg backout 28 |
|
670 | 670 | reverting a |
|
671 | 671 | changeset 29:484c03b8dfa4 backs out changeset 28:6c56f0f7f033 |
|
672 | 672 | $ hg graft 28 |
|
673 | 673 | skipping ancestor revision 28:6c56f0f7f033 |
|
674 | 674 | [255] |
|
675 | 675 | $ hg graft 28 --force |
|
676 | 676 | grafting 28:6c56f0f7f033 "28" |
|
677 | 677 | merging a |
|
678 | 678 | $ cat a |
|
679 | 679 | abc |
|
680 | 680 | |
|
681 | 681 | graft --continue after --force |
|
682 | 682 | |
|
683 | 683 | $ echo def > a |
|
684 | 684 | $ hg ci -m 31 |
|
685 | 685 | $ hg graft 28 --force --tool internal:fail |
|
686 | 686 | grafting 28:6c56f0f7f033 "28" |
|
687 | 687 | abort: unresolved conflicts, can't continue |
|
688 | 688 | (use hg resolve and hg graft --continue) |
|
689 | 689 | [255] |
|
690 | 690 | $ hg resolve --all |
|
691 | 691 | merging a |
|
692 | 692 | warning: conflicts during merge. |
|
693 | 693 | merging a incomplete! (edit conflicts, then use 'hg resolve --mark') |
|
694 | 694 | [1] |
|
695 | 695 | $ echo abc > a |
|
696 | 696 | $ hg resolve -m a |
|
697 | 697 | (no more unresolved files) |
|
698 | 698 | $ hg graft -c |
|
699 | 699 | grafting 28:6c56f0f7f033 "28" |
|
700 | 700 | $ cat a |
|
701 | 701 | abc |
|
702 | 702 | |
|
703 | 703 | Continue testing same origin policy, using revision numbers from test above |
|
704 | 704 | but do some destructive editing of the repo: |
|
705 | 705 | |
|
706 | 706 | $ hg up -qC 7 |
|
707 | 707 | $ hg tag -l -r 13 tmp |
|
708 |
$ hg --config extensions. |
|
|
708 | $ hg --config extensions.strip= strip 2 | |
|
709 | 709 | saved backup bundle to $TESTTMP/a/.hg/strip-backup/5c095ad7e90f-backup.hg (glob) |
|
710 | 710 | $ hg graft tmp |
|
711 | 711 | skipping already grafted revision 8:9db0f28fd374 (2:ef0ef43d49e7 also has unknown origin 5c095ad7e90f) |
|
712 | 712 | [255] |
|
713 | 713 | |
|
714 | 714 | Empty graft |
|
715 | 715 | |
|
716 | 716 | $ hg up -qr 26 |
|
717 | 717 | $ hg tag -f something |
|
718 | 718 | $ hg graft -qr 27 |
|
719 | 719 | $ hg graft -f 27 |
|
720 | 720 | grafting 27:3aaa8b6725f0 "28" |
|
721 | 721 | note: graft of 27:3aaa8b6725f0 created no changes to commit |
General Comments 0
You need to be logged in to leave comments.
Login now