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