##// END OF EJS Templates
tests: better document the graft copy case...
Martin von Zweigbergk -
r42222:b9e5f385 default
parent child Browse files
Show More
@@ -1,2234 +1,2249
1 $ cat >> $HGRCPATH <<EOF
1 $ cat >> $HGRCPATH <<EOF
2 > [extdiff]
2 > [extdiff]
3 > # for portability:
3 > # for portability:
4 > pdiff = sh "$RUNTESTDIR/pdiff"
4 > pdiff = sh "$RUNTESTDIR/pdiff"
5 > EOF
5 > EOF
6
6
7 Create a repo with some stuff in it:
7 Create a repo with some stuff in it:
8
8
9 $ hg init a
9 $ hg init a
10 $ cd a
10 $ cd a
11 $ echo a > a
11 $ echo a > a
12 $ echo a > d
12 $ echo a > d
13 $ echo a > e
13 $ echo a > e
14 $ hg ci -qAm0
14 $ hg ci -qAm0
15 $ echo b > a
15 $ echo b > a
16 $ hg ci -m1 -u bar
16 $ hg ci -m1 -u bar
17 $ hg mv a b
17 $ hg mv a b
18 $ hg ci -m2
18 $ hg ci -m2
19 $ hg cp b c
19 $ hg cp b c
20 $ hg ci -m3 -u baz
20 $ hg ci -m3 -u baz
21 $ echo b > d
21 $ echo b > d
22 $ echo f > e
22 $ echo f > e
23 $ hg ci -m4
23 $ hg ci -m4
24 $ hg up -q 3
24 $ hg up -q 3
25 $ echo b > e
25 $ echo b > e
26 $ hg branch -q stable
26 $ hg branch -q stable
27 $ hg ci -m5
27 $ hg ci -m5
28 $ hg merge -q default --tool internal:local # for conflicts in e, choose 5 and ignore 4
28 $ hg merge -q default --tool internal:local # for conflicts in e, choose 5 and ignore 4
29 $ hg branch -q default
29 $ hg branch -q default
30 $ hg ci -m6
30 $ hg ci -m6
31 $ hg phase --public 3
31 $ hg phase --public 3
32 $ hg phase --force --secret 6
32 $ hg phase --force --secret 6
33
33
34 $ hg log -G --template '{author}@{rev}.{phase}: {desc}\n'
34 $ hg log -G --template '{author}@{rev}.{phase}: {desc}\n'
35 @ test@6.secret: 6
35 @ test@6.secret: 6
36 |\
36 |\
37 | o test@5.draft: 5
37 | o test@5.draft: 5
38 | |
38 | |
39 o | test@4.draft: 4
39 o | test@4.draft: 4
40 |/
40 |/
41 o baz@3.public: 3
41 o baz@3.public: 3
42 |
42 |
43 o test@2.public: 2
43 o test@2.public: 2
44 |
44 |
45 o bar@1.public: 1
45 o bar@1.public: 1
46 |
46 |
47 o test@0.public: 0
47 o test@0.public: 0
48
48
49 Test --base for grafting the merge of 4 from the perspective of 5, thus only getting the change to d
49 Test --base for grafting the merge of 4 from the perspective of 5, thus only getting the change to d
50
50
51 $ hg up -cqr 3
51 $ hg up -cqr 3
52 $ hg graft -r 6 --base 5
52 $ hg graft -r 6 --base 5
53 grafting 6:25a2b029d3ae "6" (tip)
53 grafting 6:25a2b029d3ae "6" (tip)
54 merging e
54 merging e
55 $ hg st --change .
55 $ hg st --change .
56 M d
56 M d
57
57
58 $ hg -q strip . --config extensions.strip=
58 $ hg -q strip . --config extensions.strip=
59
59
60 Test --base for collapsing changesets 2 and 3, thus getting both b and c
60 Test --base for collapsing changesets 2 and 3, thus getting both b and c
61
61
62 $ hg up -cqr 0
62 $ hg up -cqr 0
63 $ hg graft -r 3 --base 1
63 $ hg graft -r 3 --base 1
64 grafting 3:4c60f11aa304 "3"
64 grafting 3:4c60f11aa304 "3"
65 merging a and b to b
65 merging a and b to b
66 merging a and c to c
66 merging a and c to c
67 $ hg st --change .
67 $ hg st --change .
68 A b
68 A b
69 A c
69 A c
70 R a
70 R a
71
71
72 $ hg -q strip . --config extensions.strip=
72 $ hg -q strip . --config extensions.strip=
73
73
74 Specifying child as --base revision fails safely (perhaps slightly confusing, but consistent)
74 Specifying child as --base revision fails safely (perhaps slightly confusing, but consistent)
75
75
76 $ hg graft -r 2 --base 3
76 $ hg graft -r 2 --base 3
77 grafting 2:5c095ad7e90f "2"
77 grafting 2:5c095ad7e90f "2"
78 note: graft of 2:5c095ad7e90f created no changes to commit
78 note: graft of 2:5c095ad7e90f created no changes to commit
79
79
80 Can't continue without starting:
80 Can't continue without starting:
81
81
82 $ hg -q up -cr tip
82 $ hg -q up -cr tip
83 $ hg rm -q e
83 $ hg rm -q e
84 $ hg graft --continue
84 $ hg graft --continue
85 abort: no graft in progress
85 abort: no graft in progress
86 [255]
86 [255]
87 $ hg revert -r . -q e
87 $ hg revert -r . -q e
88
88
89 Need to specify a rev:
89 Need to specify a rev:
90
90
91 $ hg graft
91 $ hg graft
92 abort: no revisions specified
92 abort: no revisions specified
93 [255]
93 [255]
94
94
95 Can't graft ancestor:
95 Can't graft ancestor:
96
96
97 $ hg graft 1 2
97 $ hg graft 1 2
98 skipping ancestor revision 1:5d205f8b35b6
98 skipping ancestor revision 1:5d205f8b35b6
99 skipping ancestor revision 2:5c095ad7e90f
99 skipping ancestor revision 2:5c095ad7e90f
100 [255]
100 [255]
101
101
102 Specify revisions with -r:
102 Specify revisions with -r:
103
103
104 $ hg graft -r 1 -r 2
104 $ hg graft -r 1 -r 2
105 skipping ancestor revision 1:5d205f8b35b6
105 skipping ancestor revision 1:5d205f8b35b6
106 skipping ancestor revision 2:5c095ad7e90f
106 skipping ancestor revision 2:5c095ad7e90f
107 [255]
107 [255]
108
108
109 $ hg graft -r 1 2
109 $ hg graft -r 1 2
110 warning: inconsistent use of --rev might give unexpected revision ordering!
110 warning: inconsistent use of --rev might give unexpected revision ordering!
111 skipping ancestor revision 2:5c095ad7e90f
111 skipping ancestor revision 2:5c095ad7e90f
112 skipping ancestor revision 1:5d205f8b35b6
112 skipping ancestor revision 1:5d205f8b35b6
113 [255]
113 [255]
114
114
115 Conflicting date/user options:
115 Conflicting date/user options:
116
116
117 $ hg up -q 0
117 $ hg up -q 0
118 $ hg graft -U --user foo 2
118 $ hg graft -U --user foo 2
119 abort: --user and --currentuser are mutually exclusive
119 abort: --user and --currentuser are mutually exclusive
120 [255]
120 [255]
121 $ hg graft -D --date '0 0' 2
121 $ hg graft -D --date '0 0' 2
122 abort: --date and --currentdate are mutually exclusive
122 abort: --date and --currentdate are mutually exclusive
123 [255]
123 [255]
124
124
125 Can't graft with dirty wd:
125 Can't graft with dirty wd:
126
126
127 $ hg up -q 0
127 $ hg up -q 0
128 $ echo foo > a
128 $ echo foo > a
129 $ hg graft 1
129 $ hg graft 1
130 abort: uncommitted changes
130 abort: uncommitted changes
131 [255]
131 [255]
132 $ hg revert a
132 $ hg revert a
133
133
134 Graft a rename:
134 Graft a rename:
135 (this also tests that editor is invoked if '--edit' is specified)
135 (this also tests that editor is invoked if '--edit' is specified)
136
136
137 $ hg status --rev "2^1" --rev 2
137 $ hg status --rev "2^1" --rev 2
138 A b
138 A b
139 R a
139 R a
140 $ HGEDITOR=cat hg graft 2 -u foo --edit
140 $ HGEDITOR=cat hg graft 2 -u foo --edit
141 grafting 2:5c095ad7e90f "2"
141 grafting 2:5c095ad7e90f "2"
142 merging a and b to b
142 merging a and b to b
143 2
143 2
144
144
145
145
146 HG: Enter commit message. Lines beginning with 'HG:' are removed.
146 HG: Enter commit message. Lines beginning with 'HG:' are removed.
147 HG: Leave message empty to abort commit.
147 HG: Leave message empty to abort commit.
148 HG: --
148 HG: --
149 HG: user: foo
149 HG: user: foo
150 HG: branch 'default'
150 HG: branch 'default'
151 HG: added b
151 HG: added b
152 HG: removed a
152 HG: removed a
153 $ hg export tip --git
153 $ hg export tip --git
154 # HG changeset patch
154 # HG changeset patch
155 # User foo
155 # User foo
156 # Date 0 0
156 # Date 0 0
157 # Thu Jan 01 00:00:00 1970 +0000
157 # Thu Jan 01 00:00:00 1970 +0000
158 # Node ID ef0ef43d49e79e81ddafdc7997401ba0041efc82
158 # Node ID ef0ef43d49e79e81ddafdc7997401ba0041efc82
159 # Parent 68795b066622ca79a25816a662041d8f78f3cd9e
159 # Parent 68795b066622ca79a25816a662041d8f78f3cd9e
160 2
160 2
161
161
162 diff --git a/a b/b
162 diff --git a/a b/b
163 rename from a
163 rename from a
164 rename to b
164 rename to b
165
165
166 Look for extra:source
166 Look for extra:source
167
167
168 $ hg log --debug -r tip
168 $ hg log --debug -r tip
169 changeset: 7:ef0ef43d49e79e81ddafdc7997401ba0041efc82
169 changeset: 7:ef0ef43d49e79e81ddafdc7997401ba0041efc82
170 tag: tip
170 tag: tip
171 phase: draft
171 phase: draft
172 parent: 0:68795b066622ca79a25816a662041d8f78f3cd9e
172 parent: 0:68795b066622ca79a25816a662041d8f78f3cd9e
173 parent: -1:0000000000000000000000000000000000000000
173 parent: -1:0000000000000000000000000000000000000000
174 manifest: 7:e59b6b228f9cbf9903d5e9abf996e083a1f533eb
174 manifest: 7:e59b6b228f9cbf9903d5e9abf996e083a1f533eb
175 user: foo
175 user: foo
176 date: Thu Jan 01 00:00:00 1970 +0000
176 date: Thu Jan 01 00:00:00 1970 +0000
177 files+: b
177 files+: b
178 files-: a
178 files-: a
179 extra: branch=default
179 extra: branch=default
180 extra: source=5c095ad7e90f871700f02dd1fa5012cb4498a2d4
180 extra: source=5c095ad7e90f871700f02dd1fa5012cb4498a2d4
181 description:
181 description:
182 2
182 2
183
183
184
184
185
185
186 Graft out of order, skipping a merge and a duplicate
186 Graft out of order, skipping a merge and a duplicate
187 (this also tests that editor is not invoked if '--edit' is not specified)
187 (this also tests that editor is not invoked if '--edit' is not specified)
188
188
189 $ hg graft 1 5 4 3 'merge()' 2 -n
189 $ hg graft 1 5 4 3 'merge()' 2 -n
190 skipping ungraftable merge revision 6
190 skipping ungraftable merge revision 6
191 skipping revision 2:5c095ad7e90f (already grafted to 7:ef0ef43d49e7)
191 skipping revision 2:5c095ad7e90f (already grafted to 7:ef0ef43d49e7)
192 grafting 1:5d205f8b35b6 "1"
192 grafting 1:5d205f8b35b6 "1"
193 grafting 5:97f8bfe72746 "5"
193 grafting 5:97f8bfe72746 "5"
194 grafting 4:9c233e8e184d "4"
194 grafting 4:9c233e8e184d "4"
195 grafting 3:4c60f11aa304 "3"
195 grafting 3:4c60f11aa304 "3"
196
196
197 $ HGEDITOR=cat hg graft 1 5 'merge()' 2 --debug
197 $ HGEDITOR=cat hg graft 1 5 'merge()' 2 --debug
198 skipping ungraftable merge revision 6
198 skipping ungraftable merge revision 6
199 scanning for duplicate grafts
199 scanning for duplicate grafts
200 skipping revision 2:5c095ad7e90f (already grafted to 7:ef0ef43d49e7)
200 skipping revision 2:5c095ad7e90f (already grafted to 7:ef0ef43d49e7)
201 grafting 1:5d205f8b35b6 "1"
201 grafting 1:5d205f8b35b6 "1"
202 searching for copies back to rev 1
202 searching for copies back to rev 1
203 unmatched files in local:
203 unmatched files in local:
204 b
204 b
205 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
205 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
206 src: 'a' -> dst: 'b' *
206 src: 'a' -> dst: 'b' *
207 checking for directory renames
207 checking for directory renames
208 resolving manifests
208 resolving manifests
209 branchmerge: True, force: True, partial: False
209 branchmerge: True, force: True, partial: False
210 ancestor: 68795b066622, local: ef0ef43d49e7+, remote: 5d205f8b35b6
210 ancestor: 68795b066622, local: ef0ef43d49e7+, remote: 5d205f8b35b6
211 preserving b for resolve of b
211 preserving b for resolve of b
212 starting 4 threads for background file closing (?)
212 starting 4 threads for background file closing (?)
213 b: local copied/moved from a -> m (premerge)
213 b: local copied/moved from a -> m (premerge)
214 picked tool ':merge' for b (binary False symlink False changedelete False)
214 picked tool ':merge' for b (binary False symlink False changedelete False)
215 merging b and a to b
215 merging b and a to b
216 my b@ef0ef43d49e7+ other a@5d205f8b35b6 ancestor a@68795b066622
216 my b@ef0ef43d49e7+ other a@5d205f8b35b6 ancestor a@68795b066622
217 premerge successful
217 premerge successful
218 committing files:
218 committing files:
219 b
219 b
220 committing manifest
220 committing manifest
221 committing changelog
221 committing changelog
222 updating the branch cache
222 updating the branch cache
223 grafting 5:97f8bfe72746 "5"
223 grafting 5:97f8bfe72746 "5"
224 searching for copies back to rev 1
224 searching for copies back to rev 1
225 unmatched files in other (from topological common ancestor):
225 unmatched files in other (from topological common ancestor):
226 c
226 c
227 resolving manifests
227 resolving manifests
228 branchmerge: True, force: True, partial: False
228 branchmerge: True, force: True, partial: False
229 ancestor: 4c60f11aa304, local: 6b9e5368ca4e+, remote: 97f8bfe72746
229 ancestor: 4c60f11aa304, local: 6b9e5368ca4e+, remote: 97f8bfe72746
230 e: remote is newer -> g
230 e: remote is newer -> g
231 getting e
231 getting e
232 committing files:
232 committing files:
233 e
233 e
234 committing manifest
234 committing manifest
235 committing changelog
235 committing changelog
236 updating the branch cache
236 updating the branch cache
237 $ HGEDITOR=cat hg graft 4 3 --log --debug
237 $ HGEDITOR=cat hg graft 4 3 --log --debug
238 scanning for duplicate grafts
238 scanning for duplicate grafts
239 grafting 4:9c233e8e184d "4"
239 grafting 4:9c233e8e184d "4"
240 searching for copies back to rev 1
240 searching for copies back to rev 1
241 unmatched files in other (from topological common ancestor):
241 unmatched files in other (from topological common ancestor):
242 c
242 c
243 resolving manifests
243 resolving manifests
244 branchmerge: True, force: True, partial: False
244 branchmerge: True, force: True, partial: False
245 ancestor: 4c60f11aa304, local: 1905859650ec+, remote: 9c233e8e184d
245 ancestor: 4c60f11aa304, local: 1905859650ec+, remote: 9c233e8e184d
246 preserving e for resolve of e
246 preserving e for resolve of e
247 d: remote is newer -> g
247 d: remote is newer -> g
248 getting d
248 getting d
249 e: versions differ -> m (premerge)
249 e: versions differ -> m (premerge)
250 picked tool ':merge' for e (binary False symlink False changedelete False)
250 picked tool ':merge' for e (binary False symlink False changedelete False)
251 merging e
251 merging e
252 my e@1905859650ec+ other e@9c233e8e184d ancestor e@4c60f11aa304
252 my e@1905859650ec+ other e@9c233e8e184d ancestor e@4c60f11aa304
253 e: versions differ -> m (merge)
253 e: versions differ -> m (merge)
254 picked tool ':merge' for e (binary False symlink False changedelete False)
254 picked tool ':merge' for e (binary False symlink False changedelete False)
255 my e@1905859650ec+ other e@9c233e8e184d ancestor e@4c60f11aa304
255 my e@1905859650ec+ other e@9c233e8e184d ancestor e@4c60f11aa304
256 warning: conflicts while merging e! (edit, then use 'hg resolve --mark')
256 warning: conflicts while merging e! (edit, then use 'hg resolve --mark')
257 abort: unresolved conflicts, can't continue
257 abort: unresolved conflicts, can't continue
258 (use 'hg resolve' and 'hg graft --continue')
258 (use 'hg resolve' and 'hg graft --continue')
259 [255]
259 [255]
260
260
261 Summary should mention graft:
261 Summary should mention graft:
262
262
263 $ hg summary |grep graft
263 $ hg summary |grep graft
264 commit: 2 modified, 2 unknown, 1 unresolved (graft in progress)
264 commit: 2 modified, 2 unknown, 1 unresolved (graft in progress)
265
265
266 Using status to get more context
266 Using status to get more context
267
267
268 $ hg status --verbose
268 $ hg status --verbose
269 M d
269 M d
270 M e
270 M e
271 ? a.orig
271 ? a.orig
272 ? e.orig
272 ? e.orig
273 # The repository is in an unfinished *graft* state.
273 # The repository is in an unfinished *graft* state.
274
274
275 # Unresolved merge conflicts:
275 # Unresolved merge conflicts:
276 #
276 #
277 # e
277 # e
278 #
278 #
279 # To mark files as resolved: hg resolve --mark FILE
279 # To mark files as resolved: hg resolve --mark FILE
280
280
281 # To continue: hg graft --continue
281 # To continue: hg graft --continue
282 # To abort: hg graft --abort
282 # To abort: hg graft --abort
283
283
284
284
285 Commit while interrupted should fail:
285 Commit while interrupted should fail:
286
286
287 $ hg ci -m 'commit interrupted graft'
287 $ hg ci -m 'commit interrupted graft'
288 abort: graft in progress
288 abort: graft in progress
289 (use 'hg graft --continue' or 'hg graft --stop' to stop)
289 (use 'hg graft --continue' or 'hg graft --stop' to stop)
290 [255]
290 [255]
291
291
292 Abort the graft and try committing:
292 Abort the graft and try committing:
293
293
294 $ hg up -C .
294 $ hg up -C .
295 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
295 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
296 $ echo c >> e
296 $ echo c >> e
297 $ hg ci -mtest
297 $ hg ci -mtest
298
298
299 $ hg strip . --config extensions.strip=
299 $ hg strip . --config extensions.strip=
300 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
300 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
301 saved backup bundle to $TESTTMP/a/.hg/strip-backup/*-backup.hg (glob)
301 saved backup bundle to $TESTTMP/a/.hg/strip-backup/*-backup.hg (glob)
302
302
303 Graft again:
303 Graft again:
304
304
305 $ hg graft 1 5 4 3 'merge()' 2
305 $ hg graft 1 5 4 3 'merge()' 2
306 skipping ungraftable merge revision 6
306 skipping ungraftable merge revision 6
307 skipping revision 2:5c095ad7e90f (already grafted to 7:ef0ef43d49e7)
307 skipping revision 2:5c095ad7e90f (already grafted to 7:ef0ef43d49e7)
308 skipping revision 1:5d205f8b35b6 (already grafted to 8:6b9e5368ca4e)
308 skipping revision 1:5d205f8b35b6 (already grafted to 8:6b9e5368ca4e)
309 skipping revision 5:97f8bfe72746 (already grafted to 9:1905859650ec)
309 skipping revision 5:97f8bfe72746 (already grafted to 9:1905859650ec)
310 grafting 4:9c233e8e184d "4"
310 grafting 4:9c233e8e184d "4"
311 merging e
311 merging e
312 warning: conflicts while merging e! (edit, then use 'hg resolve --mark')
312 warning: conflicts while merging e! (edit, then use 'hg resolve --mark')
313 abort: unresolved conflicts, can't continue
313 abort: unresolved conflicts, can't continue
314 (use 'hg resolve' and 'hg graft --continue')
314 (use 'hg resolve' and 'hg graft --continue')
315 [255]
315 [255]
316
316
317 Continue without resolve should fail:
317 Continue without resolve should fail:
318
318
319 $ hg graft -c
319 $ hg graft -c
320 grafting 4:9c233e8e184d "4"
320 grafting 4:9c233e8e184d "4"
321 abort: unresolved merge conflicts (see 'hg help resolve')
321 abort: unresolved merge conflicts (see 'hg help resolve')
322 [255]
322 [255]
323
323
324 Fix up:
324 Fix up:
325
325
326 $ echo b > e
326 $ echo b > e
327 $ hg resolve -m e
327 $ hg resolve -m e
328 (no more unresolved files)
328 (no more unresolved files)
329 continue: hg graft --continue
329 continue: hg graft --continue
330
330
331 Continue with a revision should fail:
331 Continue with a revision should fail:
332
332
333 $ hg graft -c 6
333 $ hg graft -c 6
334 abort: can't specify --continue and revisions
334 abort: can't specify --continue and revisions
335 [255]
335 [255]
336
336
337 $ hg graft -c -r 6
337 $ hg graft -c -r 6
338 abort: can't specify --continue and revisions
338 abort: can't specify --continue and revisions
339 [255]
339 [255]
340
340
341 Continue for real, clobber usernames
341 Continue for real, clobber usernames
342
342
343 $ hg graft -c -U
343 $ hg graft -c -U
344 grafting 4:9c233e8e184d "4"
344 grafting 4:9c233e8e184d "4"
345 grafting 3:4c60f11aa304 "3"
345 grafting 3:4c60f11aa304 "3"
346
346
347 Compare with original:
347 Compare with original:
348
348
349 $ hg diff -r 6
349 $ hg diff -r 6
350 $ hg status --rev 0:. -C
350 $ hg status --rev 0:. -C
351 M d
351 M d
352 M e
352 M e
353 A b
353 A b
354 a
354 a
355 A c
355 A c
356 a
356 a
357 R a
357 R a
358
358
359 View graph:
359 View graph:
360
360
361 $ hg log -G --template '{author}@{rev}.{phase}: {desc}\n'
361 $ hg log -G --template '{author}@{rev}.{phase}: {desc}\n'
362 @ test@11.draft: 3
362 @ test@11.draft: 3
363 |
363 |
364 o test@10.draft: 4
364 o test@10.draft: 4
365 |
365 |
366 o test@9.draft: 5
366 o test@9.draft: 5
367 |
367 |
368 o bar@8.draft: 1
368 o bar@8.draft: 1
369 |
369 |
370 o foo@7.draft: 2
370 o foo@7.draft: 2
371 |
371 |
372 | o test@6.secret: 6
372 | o test@6.secret: 6
373 | |\
373 | |\
374 | | o test@5.draft: 5
374 | | o test@5.draft: 5
375 | | |
375 | | |
376 | o | test@4.draft: 4
376 | o | test@4.draft: 4
377 | |/
377 | |/
378 | o baz@3.public: 3
378 | o baz@3.public: 3
379 | |
379 | |
380 | o test@2.public: 2
380 | o test@2.public: 2
381 | |
381 | |
382 | o bar@1.public: 1
382 | o bar@1.public: 1
383 |/
383 |/
384 o test@0.public: 0
384 o test@0.public: 0
385
385
386 Graft again onto another branch should preserve the original source
386 Graft again onto another branch should preserve the original source
387 $ hg up -q 0
387 $ hg up -q 0
388 $ echo 'g'>g
388 $ echo 'g'>g
389 $ hg add g
389 $ hg add g
390 $ hg ci -m 7
390 $ hg ci -m 7
391 created new head
391 created new head
392 $ hg graft 7
392 $ hg graft 7
393 grafting 7:ef0ef43d49e7 "2"
393 grafting 7:ef0ef43d49e7 "2"
394
394
395 $ hg log -r 7 --template '{rev}:{node}\n'
395 $ hg log -r 7 --template '{rev}:{node}\n'
396 7:ef0ef43d49e79e81ddafdc7997401ba0041efc82
396 7:ef0ef43d49e79e81ddafdc7997401ba0041efc82
397 $ hg log -r 2 --template '{rev}:{node}\n'
397 $ hg log -r 2 --template '{rev}:{node}\n'
398 2:5c095ad7e90f871700f02dd1fa5012cb4498a2d4
398 2:5c095ad7e90f871700f02dd1fa5012cb4498a2d4
399
399
400 $ hg log --debug -r tip
400 $ hg log --debug -r tip
401 changeset: 13:7a4785234d87ec1aa420ed6b11afe40fa73e12a9
401 changeset: 13:7a4785234d87ec1aa420ed6b11afe40fa73e12a9
402 tag: tip
402 tag: tip
403 phase: draft
403 phase: draft
404 parent: 12:b592ea63bb0c19a6c5c44685ee29a2284f9f1b8f
404 parent: 12:b592ea63bb0c19a6c5c44685ee29a2284f9f1b8f
405 parent: -1:0000000000000000000000000000000000000000
405 parent: -1:0000000000000000000000000000000000000000
406 manifest: 13:dc313617b8c32457c0d589e0dbbedfe71f3cd637
406 manifest: 13:dc313617b8c32457c0d589e0dbbedfe71f3cd637
407 user: foo
407 user: foo
408 date: Thu Jan 01 00:00:00 1970 +0000
408 date: Thu Jan 01 00:00:00 1970 +0000
409 files+: b
409 files+: b
410 files-: a
410 files-: a
411 extra: branch=default
411 extra: branch=default
412 extra: intermediate-source=ef0ef43d49e79e81ddafdc7997401ba0041efc82
412 extra: intermediate-source=ef0ef43d49e79e81ddafdc7997401ba0041efc82
413 extra: source=5c095ad7e90f871700f02dd1fa5012cb4498a2d4
413 extra: source=5c095ad7e90f871700f02dd1fa5012cb4498a2d4
414 description:
414 description:
415 2
415 2
416
416
417
417
418 Disallow grafting an already grafted cset onto its original branch
418 Disallow grafting an already grafted cset onto its original branch
419 $ hg up -q 6
419 $ hg up -q 6
420 $ hg graft 7
420 $ hg graft 7
421 skipping already grafted revision 7:ef0ef43d49e7 (was grafted from 2:5c095ad7e90f)
421 skipping already grafted revision 7:ef0ef43d49e7 (was grafted from 2:5c095ad7e90f)
422 [255]
422 [255]
423
423
424 $ hg pdiff --config extensions.extdiff= --patch -r 2 -r 13
424 $ hg pdiff --config extensions.extdiff= --patch -r 2 -r 13
425 --- */hg-5c095ad7e90f.patch * (glob)
425 --- */hg-5c095ad7e90f.patch * (glob)
426 +++ */hg-7a4785234d87.patch * (glob)
426 +++ */hg-7a4785234d87.patch * (glob)
427 @@ -1,18 +1,18 @@
427 @@ -1,18 +1,18 @@
428 # HG changeset patch
428 # HG changeset patch
429 -# User test
429 -# User test
430 +# User foo
430 +# User foo
431 # Date 0 0
431 # Date 0 0
432 # Thu Jan 01 00:00:00 1970 +0000
432 # Thu Jan 01 00:00:00 1970 +0000
433 -# Node ID 5c095ad7e90f871700f02dd1fa5012cb4498a2d4
433 -# Node ID 5c095ad7e90f871700f02dd1fa5012cb4498a2d4
434 -# Parent 5d205f8b35b66bc36375c9534ffd3237730e8f04
434 -# Parent 5d205f8b35b66bc36375c9534ffd3237730e8f04
435 +# Node ID 7a4785234d87ec1aa420ed6b11afe40fa73e12a9
435 +# Node ID 7a4785234d87ec1aa420ed6b11afe40fa73e12a9
436 +# Parent b592ea63bb0c19a6c5c44685ee29a2284f9f1b8f
436 +# Parent b592ea63bb0c19a6c5c44685ee29a2284f9f1b8f
437 2
437 2
438
438
439 -diff -r 5d205f8b35b6 -r 5c095ad7e90f a
439 -diff -r 5d205f8b35b6 -r 5c095ad7e90f a
440 +diff -r b592ea63bb0c -r 7a4785234d87 a
440 +diff -r b592ea63bb0c -r 7a4785234d87 a
441 --- a/a Thu Jan 01 00:00:00 1970 +0000
441 --- a/a Thu Jan 01 00:00:00 1970 +0000
442 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
442 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
443 @@ -1,1 +0,0 @@
443 @@ -1,1 +0,0 @@
444 --b
444 --b
445 -diff -r 5d205f8b35b6 -r 5c095ad7e90f b
445 -diff -r 5d205f8b35b6 -r 5c095ad7e90f b
446 +-a
446 +-a
447 +diff -r b592ea63bb0c -r 7a4785234d87 b
447 +diff -r b592ea63bb0c -r 7a4785234d87 b
448 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
448 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
449 +++ b/b Thu Jan 01 00:00:00 1970 +0000
449 +++ b/b Thu Jan 01 00:00:00 1970 +0000
450 @@ -0,0 +1,1 @@
450 @@ -0,0 +1,1 @@
451 -+b
451 -+b
452 ++a
452 ++a
453 [1]
453 [1]
454
454
455 $ hg pdiff --config extensions.extdiff= --patch -r 2 -r 13 -X .
455 $ hg pdiff --config extensions.extdiff= --patch -r 2 -r 13 -X .
456 --- */hg-5c095ad7e90f.patch * (glob)
456 --- */hg-5c095ad7e90f.patch * (glob)
457 +++ */hg-7a4785234d87.patch * (glob)
457 +++ */hg-7a4785234d87.patch * (glob)
458 @@ -1,8 +1,8 @@
458 @@ -1,8 +1,8 @@
459 # HG changeset patch
459 # HG changeset patch
460 -# User test
460 -# User test
461 +# User foo
461 +# User foo
462 # Date 0 0
462 # Date 0 0
463 # Thu Jan 01 00:00:00 1970 +0000
463 # Thu Jan 01 00:00:00 1970 +0000
464 -# Node ID 5c095ad7e90f871700f02dd1fa5012cb4498a2d4
464 -# Node ID 5c095ad7e90f871700f02dd1fa5012cb4498a2d4
465 -# Parent 5d205f8b35b66bc36375c9534ffd3237730e8f04
465 -# Parent 5d205f8b35b66bc36375c9534ffd3237730e8f04
466 +# Node ID 7a4785234d87ec1aa420ed6b11afe40fa73e12a9
466 +# Node ID 7a4785234d87ec1aa420ed6b11afe40fa73e12a9
467 +# Parent b592ea63bb0c19a6c5c44685ee29a2284f9f1b8f
467 +# Parent b592ea63bb0c19a6c5c44685ee29a2284f9f1b8f
468 2
468 2
469
469
470 [1]
470 [1]
471
471
472 Disallow grafting already grafted csets with the same origin onto each other
472 Disallow grafting already grafted csets with the same origin onto each other
473 $ hg up -q 13
473 $ hg up -q 13
474 $ hg graft 2
474 $ hg graft 2
475 skipping revision 2:5c095ad7e90f (already grafted to 13:7a4785234d87)
475 skipping revision 2:5c095ad7e90f (already grafted to 13:7a4785234d87)
476 [255]
476 [255]
477 $ hg graft 7
477 $ hg graft 7
478 skipping already grafted revision 7:ef0ef43d49e7 (13:7a4785234d87 also has origin 2:5c095ad7e90f)
478 skipping already grafted revision 7:ef0ef43d49e7 (13:7a4785234d87 also has origin 2:5c095ad7e90f)
479 [255]
479 [255]
480
480
481 $ hg up -q 7
481 $ hg up -q 7
482 $ hg graft 2
482 $ hg graft 2
483 skipping revision 2:5c095ad7e90f (already grafted to 7:ef0ef43d49e7)
483 skipping revision 2:5c095ad7e90f (already grafted to 7:ef0ef43d49e7)
484 [255]
484 [255]
485 $ hg graft tip
485 $ hg graft tip
486 skipping already grafted revision 13:7a4785234d87 (7:ef0ef43d49e7 also has origin 2:5c095ad7e90f)
486 skipping already grafted revision 13:7a4785234d87 (7:ef0ef43d49e7 also has origin 2:5c095ad7e90f)
487 [255]
487 [255]
488
488
489 Graft with --log
489 Graft with --log
490
490
491 $ hg up -Cq 1
491 $ hg up -Cq 1
492 $ hg graft 3 --log -u foo
492 $ hg graft 3 --log -u foo
493 grafting 3:4c60f11aa304 "3"
493 grafting 3:4c60f11aa304 "3"
494 warning: can't find ancestor for 'c' copied from 'b'!
494 warning: can't find ancestor for 'c' copied from 'b'!
495 $ hg log --template '{rev}:{node|short} {parents} {desc}\n' -r tip
495 $ hg log --template '{rev}:{node|short} {parents} {desc}\n' -r tip
496 14:0c921c65ef1e 1:5d205f8b35b6 3
496 14:0c921c65ef1e 1:5d205f8b35b6 3
497 (grafted from 4c60f11aa304a54ae1c199feb94e7fc771e51ed8)
497 (grafted from 4c60f11aa304a54ae1c199feb94e7fc771e51ed8)
498
498
499 Resolve conflicted graft
499 Resolve conflicted graft
500 $ hg up -q 0
500 $ hg up -q 0
501 $ echo b > a
501 $ echo b > a
502 $ hg ci -m 8
502 $ hg ci -m 8
503 created new head
503 created new head
504 $ echo c > a
504 $ echo c > a
505 $ hg ci -m 9
505 $ hg ci -m 9
506 $ hg graft 1 --tool internal:fail
506 $ hg graft 1 --tool internal:fail
507 grafting 1:5d205f8b35b6 "1"
507 grafting 1:5d205f8b35b6 "1"
508 abort: unresolved conflicts, can't continue
508 abort: unresolved conflicts, can't continue
509 (use 'hg resolve' and 'hg graft --continue')
509 (use 'hg resolve' and 'hg graft --continue')
510 [255]
510 [255]
511 $ hg resolve --all
511 $ hg resolve --all
512 merging a
512 merging a
513 warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
513 warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
514 [1]
514 [1]
515 $ cat a
515 $ cat a
516 <<<<<<< local: aaa4406d4f0a - test: 9
516 <<<<<<< local: aaa4406d4f0a - test: 9
517 c
517 c
518 =======
518 =======
519 b
519 b
520 >>>>>>> graft: 5d205f8b35b6 - bar: 1
520 >>>>>>> graft: 5d205f8b35b6 - bar: 1
521 $ echo b > a
521 $ echo b > a
522 $ hg resolve -m a
522 $ hg resolve -m a
523 (no more unresolved files)
523 (no more unresolved files)
524 continue: hg graft --continue
524 continue: hg graft --continue
525 $ hg graft -c
525 $ hg graft -c
526 grafting 1:5d205f8b35b6 "1"
526 grafting 1:5d205f8b35b6 "1"
527 $ hg export tip --git
527 $ hg export tip --git
528 # HG changeset patch
528 # HG changeset patch
529 # User bar
529 # User bar
530 # Date 0 0
530 # Date 0 0
531 # Thu Jan 01 00:00:00 1970 +0000
531 # Thu Jan 01 00:00:00 1970 +0000
532 # Node ID f67661df0c4804d301f064f332b57e7d5ddaf2be
532 # Node ID f67661df0c4804d301f064f332b57e7d5ddaf2be
533 # Parent aaa4406d4f0ae9befd6e58c82ec63706460cbca6
533 # Parent aaa4406d4f0ae9befd6e58c82ec63706460cbca6
534 1
534 1
535
535
536 diff --git a/a b/a
536 diff --git a/a b/a
537 --- a/a
537 --- a/a
538 +++ b/a
538 +++ b/a
539 @@ -1,1 +1,1 @@
539 @@ -1,1 +1,1 @@
540 -c
540 -c
541 +b
541 +b
542
542
543 Resolve conflicted graft with rename
543 Resolve conflicted graft with rename
544 $ echo c > a
544 $ echo c > a
545 $ hg ci -m 10
545 $ hg ci -m 10
546 $ hg graft 2 --tool internal:fail
546 $ hg graft 2 --tool internal:fail
547 grafting 2:5c095ad7e90f "2"
547 grafting 2:5c095ad7e90f "2"
548 abort: unresolved conflicts, can't continue
548 abort: unresolved conflicts, can't continue
549 (use 'hg resolve' and 'hg graft --continue')
549 (use 'hg resolve' and 'hg graft --continue')
550 [255]
550 [255]
551 $ hg resolve --all
551 $ hg resolve --all
552 merging a and b to b
552 merging a and b to b
553 (no more unresolved files)
553 (no more unresolved files)
554 continue: hg graft --continue
554 continue: hg graft --continue
555 $ hg graft -c
555 $ hg graft -c
556 grafting 2:5c095ad7e90f "2"
556 grafting 2:5c095ad7e90f "2"
557 $ hg export tip --git
557 $ hg export tip --git
558 # HG changeset patch
558 # HG changeset patch
559 # User test
559 # User test
560 # Date 0 0
560 # Date 0 0
561 # Thu Jan 01 00:00:00 1970 +0000
561 # Thu Jan 01 00:00:00 1970 +0000
562 # Node ID 9627f653b421c61fc1ea4c4e366745070fa3d2bc
562 # Node ID 9627f653b421c61fc1ea4c4e366745070fa3d2bc
563 # Parent ee295f490a40b97f3d18dd4c4f1c8936c233b612
563 # Parent ee295f490a40b97f3d18dd4c4f1c8936c233b612
564 2
564 2
565
565
566 diff --git a/a b/b
566 diff --git a/a b/b
567 rename from a
567 rename from a
568 rename to b
568 rename to b
569
569
570 Test simple origin(), with and without args
570 Test simple origin(), with and without args
571 $ hg log -r 'origin()'
571 $ hg log -r 'origin()'
572 changeset: 1:5d205f8b35b6
572 changeset: 1:5d205f8b35b6
573 user: bar
573 user: bar
574 date: Thu Jan 01 00:00:00 1970 +0000
574 date: Thu Jan 01 00:00:00 1970 +0000
575 summary: 1
575 summary: 1
576
576
577 changeset: 2:5c095ad7e90f
577 changeset: 2:5c095ad7e90f
578 user: test
578 user: test
579 date: Thu Jan 01 00:00:00 1970 +0000
579 date: Thu Jan 01 00:00:00 1970 +0000
580 summary: 2
580 summary: 2
581
581
582 changeset: 3:4c60f11aa304
582 changeset: 3:4c60f11aa304
583 user: baz
583 user: baz
584 date: Thu Jan 01 00:00:00 1970 +0000
584 date: Thu Jan 01 00:00:00 1970 +0000
585 summary: 3
585 summary: 3
586
586
587 changeset: 4:9c233e8e184d
587 changeset: 4:9c233e8e184d
588 user: test
588 user: test
589 date: Thu Jan 01 00:00:00 1970 +0000
589 date: Thu Jan 01 00:00:00 1970 +0000
590 summary: 4
590 summary: 4
591
591
592 changeset: 5:97f8bfe72746
592 changeset: 5:97f8bfe72746
593 branch: stable
593 branch: stable
594 parent: 3:4c60f11aa304
594 parent: 3:4c60f11aa304
595 user: test
595 user: test
596 date: Thu Jan 01 00:00:00 1970 +0000
596 date: Thu Jan 01 00:00:00 1970 +0000
597 summary: 5
597 summary: 5
598
598
599 $ hg log -r 'origin(7)'
599 $ hg log -r 'origin(7)'
600 changeset: 2:5c095ad7e90f
600 changeset: 2:5c095ad7e90f
601 user: test
601 user: test
602 date: Thu Jan 01 00:00:00 1970 +0000
602 date: Thu Jan 01 00:00:00 1970 +0000
603 summary: 2
603 summary: 2
604
604
605 Now transplant a graft to test following through copies
605 Now transplant a graft to test following through copies
606 $ hg up -q 0
606 $ hg up -q 0
607 $ hg branch -q dev
607 $ hg branch -q dev
608 $ hg ci -qm "dev branch"
608 $ hg ci -qm "dev branch"
609 $ hg --config extensions.transplant= transplant -q 7
609 $ hg --config extensions.transplant= transplant -q 7
610 $ hg log -r 'origin(.)'
610 $ hg log -r 'origin(.)'
611 changeset: 2:5c095ad7e90f
611 changeset: 2:5c095ad7e90f
612 user: test
612 user: test
613 date: Thu Jan 01 00:00:00 1970 +0000
613 date: Thu Jan 01 00:00:00 1970 +0000
614 summary: 2
614 summary: 2
615
615
616 Test that the graft and transplant markers in extra are converted, allowing
616 Test that the graft and transplant markers in extra are converted, allowing
617 origin() to still work. Note that these recheck the immediately preceeding two
617 origin() to still work. Note that these recheck the immediately preceeding two
618 tests.
618 tests.
619 $ hg --quiet --config extensions.convert= --config convert.hg.saverev=True convert . ../converted
619 $ hg --quiet --config extensions.convert= --config convert.hg.saverev=True convert . ../converted
620
620
621 The graft case
621 The graft case
622 $ hg -R ../converted log -r 7 --template "{rev}: {node}\n{join(extras, '\n')}\n"
622 $ hg -R ../converted log -r 7 --template "{rev}: {node}\n{join(extras, '\n')}\n"
623 7: 7ae846e9111fc8f57745634250c7b9ac0a60689b
623 7: 7ae846e9111fc8f57745634250c7b9ac0a60689b
624 branch=default
624 branch=default
625 convert_revision=ef0ef43d49e79e81ddafdc7997401ba0041efc82
625 convert_revision=ef0ef43d49e79e81ddafdc7997401ba0041efc82
626 source=e0213322b2c1a5d5d236c74e79666441bee67a7d
626 source=e0213322b2c1a5d5d236c74e79666441bee67a7d
627 $ hg -R ../converted log -r 'origin(7)'
627 $ hg -R ../converted log -r 'origin(7)'
628 changeset: 2:e0213322b2c1
628 changeset: 2:e0213322b2c1
629 user: test
629 user: test
630 date: Thu Jan 01 00:00:00 1970 +0000
630 date: Thu Jan 01 00:00:00 1970 +0000
631 summary: 2
631 summary: 2
632
632
633 Test that template correctly expands more than one 'extra' (issue4362), and that
633 Test that template correctly expands more than one 'extra' (issue4362), and that
634 'intermediate-source' is converted.
634 'intermediate-source' is converted.
635 $ hg -R ../converted log -r 13 --template "{extras % ' Extra: {extra}\n'}"
635 $ hg -R ../converted log -r 13 --template "{extras % ' Extra: {extra}\n'}"
636 Extra: branch=default
636 Extra: branch=default
637 Extra: convert_revision=7a4785234d87ec1aa420ed6b11afe40fa73e12a9
637 Extra: convert_revision=7a4785234d87ec1aa420ed6b11afe40fa73e12a9
638 Extra: intermediate-source=7ae846e9111fc8f57745634250c7b9ac0a60689b
638 Extra: intermediate-source=7ae846e9111fc8f57745634250c7b9ac0a60689b
639 Extra: source=e0213322b2c1a5d5d236c74e79666441bee67a7d
639 Extra: source=e0213322b2c1a5d5d236c74e79666441bee67a7d
640
640
641 The transplant case
641 The transplant case
642 $ hg -R ../converted log -r tip --template "{rev}: {node}\n{join(extras, '\n')}\n"
642 $ hg -R ../converted log -r tip --template "{rev}: {node}\n{join(extras, '\n')}\n"
643 21: fbb6c5cc81002f2b4b49c9d731404688bcae5ade
643 21: fbb6c5cc81002f2b4b49c9d731404688bcae5ade
644 branch=dev
644 branch=dev
645 convert_revision=7e61b508e709a11d28194a5359bc3532d910af21
645 convert_revision=7e61b508e709a11d28194a5359bc3532d910af21
646 transplant_source=z\xe8F\xe9\x11\x1f\xc8\xf5wEcBP\xc7\xb9\xac\n`h\x9b
646 transplant_source=z\xe8F\xe9\x11\x1f\xc8\xf5wEcBP\xc7\xb9\xac\n`h\x9b
647 $ hg -R ../converted log -r 'origin(tip)'
647 $ hg -R ../converted log -r 'origin(tip)'
648 changeset: 2:e0213322b2c1
648 changeset: 2:e0213322b2c1
649 user: test
649 user: test
650 date: Thu Jan 01 00:00:00 1970 +0000
650 date: Thu Jan 01 00:00:00 1970 +0000
651 summary: 2
651 summary: 2
652
652
653
653
654 Test simple destination
654 Test simple destination
655 $ hg log -r 'destination()'
655 $ hg log -r 'destination()'
656 changeset: 7:ef0ef43d49e7
656 changeset: 7:ef0ef43d49e7
657 parent: 0:68795b066622
657 parent: 0:68795b066622
658 user: foo
658 user: foo
659 date: Thu Jan 01 00:00:00 1970 +0000
659 date: Thu Jan 01 00:00:00 1970 +0000
660 summary: 2
660 summary: 2
661
661
662 changeset: 8:6b9e5368ca4e
662 changeset: 8:6b9e5368ca4e
663 user: bar
663 user: bar
664 date: Thu Jan 01 00:00:00 1970 +0000
664 date: Thu Jan 01 00:00:00 1970 +0000
665 summary: 1
665 summary: 1
666
666
667 changeset: 9:1905859650ec
667 changeset: 9:1905859650ec
668 user: test
668 user: test
669 date: Thu Jan 01 00:00:00 1970 +0000
669 date: Thu Jan 01 00:00:00 1970 +0000
670 summary: 5
670 summary: 5
671
671
672 changeset: 10:52dc0b4c6907
672 changeset: 10:52dc0b4c6907
673 user: test
673 user: test
674 date: Thu Jan 01 00:00:00 1970 +0000
674 date: Thu Jan 01 00:00:00 1970 +0000
675 summary: 4
675 summary: 4
676
676
677 changeset: 11:882b35362a6b
677 changeset: 11:882b35362a6b
678 user: test
678 user: test
679 date: Thu Jan 01 00:00:00 1970 +0000
679 date: Thu Jan 01 00:00:00 1970 +0000
680 summary: 3
680 summary: 3
681
681
682 changeset: 13:7a4785234d87
682 changeset: 13:7a4785234d87
683 user: foo
683 user: foo
684 date: Thu Jan 01 00:00:00 1970 +0000
684 date: Thu Jan 01 00:00:00 1970 +0000
685 summary: 2
685 summary: 2
686
686
687 changeset: 14:0c921c65ef1e
687 changeset: 14:0c921c65ef1e
688 parent: 1:5d205f8b35b6
688 parent: 1:5d205f8b35b6
689 user: foo
689 user: foo
690 date: Thu Jan 01 00:00:00 1970 +0000
690 date: Thu Jan 01 00:00:00 1970 +0000
691 summary: 3
691 summary: 3
692
692
693 changeset: 17:f67661df0c48
693 changeset: 17:f67661df0c48
694 user: bar
694 user: bar
695 date: Thu Jan 01 00:00:00 1970 +0000
695 date: Thu Jan 01 00:00:00 1970 +0000
696 summary: 1
696 summary: 1
697
697
698 changeset: 19:9627f653b421
698 changeset: 19:9627f653b421
699 user: test
699 user: test
700 date: Thu Jan 01 00:00:00 1970 +0000
700 date: Thu Jan 01 00:00:00 1970 +0000
701 summary: 2
701 summary: 2
702
702
703 changeset: 21:7e61b508e709
703 changeset: 21:7e61b508e709
704 branch: dev
704 branch: dev
705 tag: tip
705 tag: tip
706 user: foo
706 user: foo
707 date: Thu Jan 01 00:00:00 1970 +0000
707 date: Thu Jan 01 00:00:00 1970 +0000
708 summary: 2
708 summary: 2
709
709
710 $ hg log -r 'destination(2)'
710 $ hg log -r 'destination(2)'
711 changeset: 7:ef0ef43d49e7
711 changeset: 7:ef0ef43d49e7
712 parent: 0:68795b066622
712 parent: 0:68795b066622
713 user: foo
713 user: foo
714 date: Thu Jan 01 00:00:00 1970 +0000
714 date: Thu Jan 01 00:00:00 1970 +0000
715 summary: 2
715 summary: 2
716
716
717 changeset: 13:7a4785234d87
717 changeset: 13:7a4785234d87
718 user: foo
718 user: foo
719 date: Thu Jan 01 00:00:00 1970 +0000
719 date: Thu Jan 01 00:00:00 1970 +0000
720 summary: 2
720 summary: 2
721
721
722 changeset: 19:9627f653b421
722 changeset: 19:9627f653b421
723 user: test
723 user: test
724 date: Thu Jan 01 00:00:00 1970 +0000
724 date: Thu Jan 01 00:00:00 1970 +0000
725 summary: 2
725 summary: 2
726
726
727 changeset: 21:7e61b508e709
727 changeset: 21:7e61b508e709
728 branch: dev
728 branch: dev
729 tag: tip
729 tag: tip
730 user: foo
730 user: foo
731 date: Thu Jan 01 00:00:00 1970 +0000
731 date: Thu Jan 01 00:00:00 1970 +0000
732 summary: 2
732 summary: 2
733
733
734 Transplants of grafts can find a destination...
734 Transplants of grafts can find a destination...
735 $ hg log -r 'destination(7)'
735 $ hg log -r 'destination(7)'
736 changeset: 21:7e61b508e709
736 changeset: 21:7e61b508e709
737 branch: dev
737 branch: dev
738 tag: tip
738 tag: tip
739 user: foo
739 user: foo
740 date: Thu Jan 01 00:00:00 1970 +0000
740 date: Thu Jan 01 00:00:00 1970 +0000
741 summary: 2
741 summary: 2
742
742
743 ... grafts of grafts unfortunately can't
743 ... grafts of grafts unfortunately can't
744 $ hg graft -q 13 --debug
744 $ hg graft -q 13 --debug
745 scanning for duplicate grafts
745 scanning for duplicate grafts
746 grafting 13:7a4785234d87 "2"
746 grafting 13:7a4785234d87 "2"
747 searching for copies back to rev 12
747 searching for copies back to rev 12
748 unmatched files in other (from topological common ancestor):
748 unmatched files in other (from topological common ancestor):
749 g
749 g
750 unmatched files new in both:
750 unmatched files new in both:
751 b
751 b
752 resolving manifests
752 resolving manifests
753 branchmerge: True, force: True, partial: False
753 branchmerge: True, force: True, partial: False
754 ancestor: b592ea63bb0c, local: 7e61b508e709+, remote: 7a4785234d87
754 ancestor: b592ea63bb0c, local: 7e61b508e709+, remote: 7a4785234d87
755 starting 4 threads for background file closing (?)
755 starting 4 threads for background file closing (?)
756 committing files:
756 committing files:
757 b
757 b
758 warning: can't find ancestor for 'b' copied from 'a'!
758 warning: can't find ancestor for 'b' copied from 'a'!
759 reusing manifest form p1 (listed files actually unchanged)
759 reusing manifest form p1 (listed files actually unchanged)
760 committing changelog
760 committing changelog
761 updating the branch cache
761 updating the branch cache
762 $ hg log -r 'destination(13)'
762 $ hg log -r 'destination(13)'
763 All copies of a cset
763 All copies of a cset
764 $ hg log -r 'origin(13) or destination(origin(13))'
764 $ hg log -r 'origin(13) or destination(origin(13))'
765 changeset: 2:5c095ad7e90f
765 changeset: 2:5c095ad7e90f
766 user: test
766 user: test
767 date: Thu Jan 01 00:00:00 1970 +0000
767 date: Thu Jan 01 00:00:00 1970 +0000
768 summary: 2
768 summary: 2
769
769
770 changeset: 7:ef0ef43d49e7
770 changeset: 7:ef0ef43d49e7
771 parent: 0:68795b066622
771 parent: 0:68795b066622
772 user: foo
772 user: foo
773 date: Thu Jan 01 00:00:00 1970 +0000
773 date: Thu Jan 01 00:00:00 1970 +0000
774 summary: 2
774 summary: 2
775
775
776 changeset: 13:7a4785234d87
776 changeset: 13:7a4785234d87
777 user: foo
777 user: foo
778 date: Thu Jan 01 00:00:00 1970 +0000
778 date: Thu Jan 01 00:00:00 1970 +0000
779 summary: 2
779 summary: 2
780
780
781 changeset: 19:9627f653b421
781 changeset: 19:9627f653b421
782 user: test
782 user: test
783 date: Thu Jan 01 00:00:00 1970 +0000
783 date: Thu Jan 01 00:00:00 1970 +0000
784 summary: 2
784 summary: 2
785
785
786 changeset: 21:7e61b508e709
786 changeset: 21:7e61b508e709
787 branch: dev
787 branch: dev
788 user: foo
788 user: foo
789 date: Thu Jan 01 00:00:00 1970 +0000
789 date: Thu Jan 01 00:00:00 1970 +0000
790 summary: 2
790 summary: 2
791
791
792 changeset: 22:3a4e92d81b97
792 changeset: 22:3a4e92d81b97
793 branch: dev
793 branch: dev
794 tag: tip
794 tag: tip
795 user: foo
795 user: foo
796 date: Thu Jan 01 00:00:00 1970 +0000
796 date: Thu Jan 01 00:00:00 1970 +0000
797 summary: 2
797 summary: 2
798
798
799
799
800 graft works on complex revset
800 graft works on complex revset
801
801
802 $ hg graft 'origin(13) or destination(origin(13))'
802 $ hg graft 'origin(13) or destination(origin(13))'
803 skipping ancestor revision 21:7e61b508e709
803 skipping ancestor revision 21:7e61b508e709
804 skipping ancestor revision 22:3a4e92d81b97
804 skipping ancestor revision 22:3a4e92d81b97
805 skipping revision 2:5c095ad7e90f (already grafted to 22:3a4e92d81b97)
805 skipping revision 2:5c095ad7e90f (already grafted to 22:3a4e92d81b97)
806 grafting 7:ef0ef43d49e7 "2"
806 grafting 7:ef0ef43d49e7 "2"
807 warning: can't find ancestor for 'b' copied from 'a'!
807 warning: can't find ancestor for 'b' copied from 'a'!
808 grafting 13:7a4785234d87 "2"
808 grafting 13:7a4785234d87 "2"
809 warning: can't find ancestor for 'b' copied from 'a'!
809 warning: can't find ancestor for 'b' copied from 'a'!
810 grafting 19:9627f653b421 "2"
810 grafting 19:9627f653b421 "2"
811 merging b
811 merging b
812 warning: can't find ancestor for 'b' copied from 'a'!
812 warning: can't find ancestor for 'b' copied from 'a'!
813
813
814 graft with --force (still doesn't graft merges)
814 graft with --force (still doesn't graft merges)
815
815
816 $ hg graft 19 0 6
816 $ hg graft 19 0 6
817 skipping ungraftable merge revision 6
817 skipping ungraftable merge revision 6
818 skipping ancestor revision 0:68795b066622
818 skipping ancestor revision 0:68795b066622
819 skipping already grafted revision 19:9627f653b421 (22:3a4e92d81b97 also has origin 2:5c095ad7e90f)
819 skipping already grafted revision 19:9627f653b421 (22:3a4e92d81b97 also has origin 2:5c095ad7e90f)
820 [255]
820 [255]
821 $ hg graft 19 0 6 --force
821 $ hg graft 19 0 6 --force
822 skipping ungraftable merge revision 6
822 skipping ungraftable merge revision 6
823 grafting 19:9627f653b421 "2"
823 grafting 19:9627f653b421 "2"
824 merging b
824 merging b
825 warning: can't find ancestor for 'b' copied from 'a'!
825 warning: can't find ancestor for 'b' copied from 'a'!
826 grafting 0:68795b066622 "0"
826 grafting 0:68795b066622 "0"
827
827
828 graft --force after backout
828 graft --force after backout
829
829
830 $ echo abc > a
830 $ echo abc > a
831 $ hg ci -m 28
831 $ hg ci -m 28
832 $ hg backout 28
832 $ hg backout 28
833 reverting a
833 reverting a
834 changeset 29:9d95e865b00c backs out changeset 28:cc20d29aec8d
834 changeset 29:9d95e865b00c backs out changeset 28:cc20d29aec8d
835 $ hg graft 28
835 $ hg graft 28
836 skipping ancestor revision 28:cc20d29aec8d
836 skipping ancestor revision 28:cc20d29aec8d
837 [255]
837 [255]
838 $ hg graft 28 --force
838 $ hg graft 28 --force
839 grafting 28:cc20d29aec8d "28"
839 grafting 28:cc20d29aec8d "28"
840 merging a
840 merging a
841 $ cat a
841 $ cat a
842 abc
842 abc
843
843
844 graft --continue after --force
844 graft --continue after --force
845
845
846 $ echo def > a
846 $ echo def > a
847 $ hg ci -m 31
847 $ hg ci -m 31
848 $ hg graft 28 --force --tool internal:fail
848 $ hg graft 28 --force --tool internal:fail
849 grafting 28:cc20d29aec8d "28"
849 grafting 28:cc20d29aec8d "28"
850 abort: unresolved conflicts, can't continue
850 abort: unresolved conflicts, can't continue
851 (use 'hg resolve' and 'hg graft --continue')
851 (use 'hg resolve' and 'hg graft --continue')
852 [255]
852 [255]
853 $ hg resolve --all
853 $ hg resolve --all
854 merging a
854 merging a
855 warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
855 warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
856 [1]
856 [1]
857 $ echo abc > a
857 $ echo abc > a
858 $ hg resolve -m a
858 $ hg resolve -m a
859 (no more unresolved files)
859 (no more unresolved files)
860 continue: hg graft --continue
860 continue: hg graft --continue
861 $ hg graft -c
861 $ hg graft -c
862 grafting 28:cc20d29aec8d "28"
862 grafting 28:cc20d29aec8d "28"
863 $ cat a
863 $ cat a
864 abc
864 abc
865
865
866 Continue testing same origin policy, using revision numbers from test above
866 Continue testing same origin policy, using revision numbers from test above
867 but do some destructive editing of the repo:
867 but do some destructive editing of the repo:
868
868
869 $ hg up -qC 7
869 $ hg up -qC 7
870 $ hg tag -l -r 13 tmp
870 $ hg tag -l -r 13 tmp
871 $ hg --config extensions.strip= strip 2
871 $ hg --config extensions.strip= strip 2
872 saved backup bundle to $TESTTMP/a/.hg/strip-backup/5c095ad7e90f-d323a1e4-backup.hg
872 saved backup bundle to $TESTTMP/a/.hg/strip-backup/5c095ad7e90f-d323a1e4-backup.hg
873 $ hg graft tmp
873 $ hg graft tmp
874 skipping already grafted revision 8:7a4785234d87 (2:ef0ef43d49e7 also has unknown origin 5c095ad7e90f)
874 skipping already grafted revision 8:7a4785234d87 (2:ef0ef43d49e7 also has unknown origin 5c095ad7e90f)
875 [255]
875 [255]
876
876
877 Empty graft
877 Empty graft
878
878
879 $ hg up -qr 26
879 $ hg up -qr 26
880 $ hg tag -f something
880 $ hg tag -f something
881 $ hg graft -qr 27
881 $ hg graft -qr 27
882 $ hg graft -f 27
882 $ hg graft -f 27
883 grafting 27:17d42b8f5d50 "28"
883 grafting 27:17d42b8f5d50 "28"
884 note: graft of 27:17d42b8f5d50 created no changes to commit
884 note: graft of 27:17d42b8f5d50 created no changes to commit
885
885
886 $ cd ..
886 $ cd ..
887
887
888 Graft to duplicate a commit
888 Graft to duplicate a commit
889
889
890 $ hg init graftsibling
890 $ hg init graftsibling
891 $ cd graftsibling
891 $ cd graftsibling
892 $ touch a
892 $ touch a
893 $ hg commit -qAm a
893 $ hg commit -qAm a
894 $ touch b
894 $ touch b
895 $ hg commit -qAm b
895 $ hg commit -qAm b
896 $ hg log -G -T '{rev}\n'
896 $ hg log -G -T '{rev}\n'
897 @ 1
897 @ 1
898 |
898 |
899 o 0
899 o 0
900
900
901 $ hg up -q 0
901 $ hg up -q 0
902 $ hg graft -r 1
902 $ hg graft -r 1
903 grafting 1:0e067c57feba "b" (tip)
903 grafting 1:0e067c57feba "b" (tip)
904 $ hg log -G -T '{rev}\n'
904 $ hg log -G -T '{rev}\n'
905 @ 2
905 @ 2
906 |
906 |
907 | o 1
907 | o 1
908 |/
908 |/
909 o 0
909 o 0
910
910
911 Graft to duplicate a commit twice
911 Graft to duplicate a commit twice
912
912
913 $ hg up -q 0
913 $ hg up -q 0
914 $ hg graft -r 2
914 $ hg graft -r 2
915 grafting 2:044ec77f6389 "b" (tip)
915 grafting 2:044ec77f6389 "b" (tip)
916 $ hg log -G -T '{rev}\n'
916 $ hg log -G -T '{rev}\n'
917 @ 3
917 @ 3
918 |
918 |
919 | o 2
919 | o 2
920 |/
920 |/
921 | o 1
921 | o 1
922 |/
922 |/
923 o 0
923 o 0
924
924
925 Graft from behind a move or rename
925 Graft from behind a move or rename
926 ==================================
926 ==================================
927
927
928 NOTE: This is affected by issue5343, and will need updating when it's fixed
928 NOTE: This is affected by issue5343, and will need updating when it's fixed
929
929
930 Possible cases during a regular graft (when ca is between cta and c2):
930 Consider this topology for a regular graft:
931
932 o c1
933 |
934 | o c2
935 | |
936 | o ca # stands for "common ancestor"
937 |/
938 o cta # stands for "common topological ancestor"
939
940 Note that in issue5343, ca==cta.
941
942 The following table shows the possible cases. Here, "x->y" and, equivalently,
943 "y<-x", where x is an ancestor of y, means that some copy happened from x to y.
931
944
932 name | c1<-cta | cta<->ca | ca->c2
945 name | c1<-cta | cta<->ca | ca->c2
933 A.0 | | |
946 A.0 | | |
934 A.1 | X | |
947 A.1 | X | |
935 A.2 | | X |
948 A.2 | | X |
936 A.3 | | | X
949 A.3 | | | X
937 A.4 | X | X |
950 A.4 | X | X |
938 A.5 | X | | X
951 A.5 | X | | X
939 A.6 | | X | X
952 A.6 | | X | X
940 A.7 | X | X | X
953 A.7 | X | X | X
941
954
942 A.0 is trivial, and doesn't need copy tracking.
955 A.0 is trivial, and doesn't need copy tracking.
943 For A.1, a forward rename is recorded in the c1 pass, to be followed later.
956 For A.1, a forward rename is recorded in the c1 pass, to be followed later.
944 In A.2, the rename is recorded in the c2 pass and followed backwards.
957 In A.2, the rename is recorded in the c2 pass and followed backwards.
945 A.3 is recorded in the c2 pass as a forward rename to be duplicated on target.
958 A.3 is recorded in the c2 pass as a forward rename to be duplicated on target.
946 In A.4, both passes of checkcopies record incomplete renames, which are
959 In A.4, both passes of checkcopies record incomplete renames, which are
947 then joined in mergecopies to record a rename to be followed.
960 then joined in mergecopies to record a rename to be followed.
948 In A.5 and A.7, the c1 pass records an incomplete rename, while the c2 pass
961 In A.5 and A.7, the c1 pass records an incomplete rename, while the c2 pass
949 records an incomplete divergence. The incomplete rename is then joined to the
962 records an incomplete divergence. The incomplete rename is then joined to the
950 appropriate side of the incomplete divergence, and the result is recorded as a
963 appropriate side of the incomplete divergence, and the result is recorded as a
951 divergence. The code doesn't distinguish at all between these two cases, since
964 divergence. The code doesn't distinguish at all between these two cases, since
952 the end result of them is the same: an incomplete divergence joined with an
965 the end result of them is the same: an incomplete divergence joined with an
953 incomplete rename into a divergence.
966 incomplete rename into a divergence.
954 Finally, A.6 records a divergence entirely in the c2 pass.
967 Finally, A.6 records a divergence entirely in the c2 pass.
955
968
956 A.4 has a degenerate case a<-b<-a->a, where checkcopies isn't needed at all.
969 A.4 has a degenerate case a<-b<-a->a, where checkcopies isn't needed at all.
957 A.5 has a special case a<-b<-b->a, which is treated like a<-b->a in a merge.
970 A.5 has a special case a<-b<-b->a, which is treated like a<-b->a in a merge.
971 A.5 has issue5343 as a special case.
972 TODO: add test coverage for A.5
958 A.6 has a special case a<-a<-b->a. Here, checkcopies will find a spurious
973 A.6 has a special case a<-a<-b->a. Here, checkcopies will find a spurious
959 incomplete divergence, which is in fact complete. This is handled later in
974 incomplete divergence, which is in fact complete. This is handled later in
960 mergecopies.
975 mergecopies.
961 A.7 has 4 special cases: a<-b<-a->b (the "ping-pong" case), a<-b<-c->b,
976 A.7 has 4 special cases: a<-b<-a->b (the "ping-pong" case), a<-b<-c->b,
962 a<-b<-a->c and a<-b<-c->a. Of these, only the "ping-pong" case is interesting,
977 a<-b<-a->c and a<-b<-c->a. Of these, only the "ping-pong" case is interesting,
963 the others are fairly trivial (a<-b<-c->b and a<-b<-a->c proceed like the base
978 the others are fairly trivial (a<-b<-c->b and a<-b<-a->c proceed like the base
964 case, a<-b<-c->a is treated the same as a<-b<-b->a).
979 case, a<-b<-c->a is treated the same as a<-b<-b->a).
965
980
966 f5a therefore tests the "ping-pong" rename case, where a file is renamed to the
981 f5a therefore tests the "ping-pong" rename case, where a file is renamed to the
967 same name on both branches, then the rename is backed out on one branch, and
982 same name on both branches, then the rename is backed out on one branch, and
968 the backout is grafted to the other branch. This creates a challenging rename
983 the backout is grafted to the other branch. This creates a challenging rename
969 sequence of a<-b<-a->b in the graft target, topological CA, graft CA and graft
984 sequence of a<-b<-a->b in the graft target, topological CA, graft CA and graft
970 source, respectively. Since rename detection will run on the c1 side for such a
985 source, respectively. Since rename detection will run on the c1 side for such a
971 sequence (as for technical reasons, we split the c1 and c2 sides not at the
986 sequence (as for technical reasons, we split the c1 and c2 sides not at the
972 graft CA, but rather at the topological CA), it will pick up a false rename,
987 graft CA, but rather at the topological CA), it will pick up a false rename,
973 and cause a spurious merge conflict. This false rename is always exactly the
988 and cause a spurious merge conflict. This false rename is always exactly the
974 reverse of the true rename that would be detected on the c2 side, so we can
989 reverse of the true rename that would be detected on the c2 side, so we can
975 correct for it by detecting this condition and reversing as necessary.
990 correct for it by detecting this condition and reversing as necessary.
976
991
977 First, set up the repository with commits to be grafted
992 First, set up the repository with commits to be grafted
978
993
979 $ hg init ../graftmove
994 $ hg init ../graftmove
980 $ cd ../graftmove
995 $ cd ../graftmove
981 $ echo c1a > f1a
996 $ echo c1a > f1a
982 $ echo c2a > f2a
997 $ echo c2a > f2a
983 $ echo c3a > f3a
998 $ echo c3a > f3a
984 $ echo c4a > f4a
999 $ echo c4a > f4a
985 $ echo c5a > f5a
1000 $ echo c5a > f5a
986 $ hg ci -qAm A0
1001 $ hg ci -qAm A0
987 $ hg mv f1a f1b
1002 $ hg mv f1a f1b
988 $ hg mv f3a f3b
1003 $ hg mv f3a f3b
989 $ hg mv f5a f5b
1004 $ hg mv f5a f5b
990 $ hg ci -qAm B0
1005 $ hg ci -qAm B0
991 $ echo c1c > f1b
1006 $ echo c1c > f1b
992 $ hg mv f2a f2c
1007 $ hg mv f2a f2c
993 $ hg mv f5b f5a
1008 $ hg mv f5b f5a
994 $ echo c5c > f5a
1009 $ echo c5c > f5a
995 $ hg ci -qAm C0
1010 $ hg ci -qAm C0
996 $ hg mv f3b f3d
1011 $ hg mv f3b f3d
997 $ echo c4d > f4a
1012 $ echo c4d > f4a
998 $ hg ci -qAm D0
1013 $ hg ci -qAm D0
999 $ hg log -G
1014 $ hg log -G
1000 @ changeset: 3:b69f5839d2d9
1015 @ changeset: 3:b69f5839d2d9
1001 | tag: tip
1016 | tag: tip
1002 | user: test
1017 | user: test
1003 | date: Thu Jan 01 00:00:00 1970 +0000
1018 | date: Thu Jan 01 00:00:00 1970 +0000
1004 | summary: D0
1019 | summary: D0
1005 |
1020 |
1006 o changeset: 2:f58c7e2b28fa
1021 o changeset: 2:f58c7e2b28fa
1007 | user: test
1022 | user: test
1008 | date: Thu Jan 01 00:00:00 1970 +0000
1023 | date: Thu Jan 01 00:00:00 1970 +0000
1009 | summary: C0
1024 | summary: C0
1010 |
1025 |
1011 o changeset: 1:3d7bba921b5d
1026 o changeset: 1:3d7bba921b5d
1012 | user: test
1027 | user: test
1013 | date: Thu Jan 01 00:00:00 1970 +0000
1028 | date: Thu Jan 01 00:00:00 1970 +0000
1014 | summary: B0
1029 | summary: B0
1015 |
1030 |
1016 o changeset: 0:11f7a1b56675
1031 o changeset: 0:11f7a1b56675
1017 user: test
1032 user: test
1018 date: Thu Jan 01 00:00:00 1970 +0000
1033 date: Thu Jan 01 00:00:00 1970 +0000
1019 summary: A0
1034 summary: A0
1020
1035
1021
1036
1022 Test the cases A.2 (f1x), A.3 (f2x) and a special case of A.6 (f5x) where the
1037 Test the cases A.2 (f1x), A.3 (f2x) and a special case of A.6 (f5x) where the
1023 two renames actually converge to the same name (thus no actual divergence).
1038 two renames actually converge to the same name (thus no actual divergence).
1024
1039
1025 $ hg up -q 'desc("A0")'
1040 $ hg up -q 'desc("A0")'
1026 $ HGEDITOR="echo C1 >" hg graft -r 'desc("C0")' --edit
1041 $ HGEDITOR="echo C1 >" hg graft -r 'desc("C0")' --edit
1027 grafting 2:f58c7e2b28fa "C0"
1042 grafting 2:f58c7e2b28fa "C0"
1028 merging f1a and f1b to f1a
1043 merging f1a and f1b to f1a
1029 merging f5a
1044 merging f5a
1030 warning: can't find ancestor for 'f5a' copied from 'f5b'!
1045 warning: can't find ancestor for 'f5a' copied from 'f5b'!
1031 $ hg status --change .
1046 $ hg status --change .
1032 M f1a
1047 M f1a
1033 M f5a
1048 M f5a
1034 A f2c
1049 A f2c
1035 R f2a
1050 R f2a
1036 $ hg cat f1a
1051 $ hg cat f1a
1037 c1c
1052 c1c
1038 $ hg cat f1b
1053 $ hg cat f1b
1039 f1b: no such file in rev c9763722f9bd
1054 f1b: no such file in rev c9763722f9bd
1040 [1]
1055 [1]
1041
1056
1042 Test the cases A.0 (f4x) and A.6 (f3x)
1057 Test the cases A.0 (f4x) and A.6 (f3x)
1043
1058
1044 $ HGEDITOR="echo D1 >" hg graft -r 'desc("D0")' --edit
1059 $ HGEDITOR="echo D1 >" hg graft -r 'desc("D0")' --edit
1045 grafting 3:b69f5839d2d9 "D0"
1060 grafting 3:b69f5839d2d9 "D0"
1046 note: possible conflict - f3b was renamed multiple times to:
1061 note: possible conflict - f3b was renamed multiple times to:
1047 f3d
1062 f3d
1048 f3a
1063 f3a
1049 warning: can't find ancestor for 'f3d' copied from 'f3b'!
1064 warning: can't find ancestor for 'f3d' copied from 'f3b'!
1050
1065
1051 Set up the repository for some further tests
1066 Set up the repository for some further tests
1052
1067
1053 $ hg up -q "min(desc("A0"))"
1068 $ hg up -q "min(desc("A0"))"
1054 $ hg mv f1a f1e
1069 $ hg mv f1a f1e
1055 $ echo c2e > f2a
1070 $ echo c2e > f2a
1056 $ hg mv f3a f3e
1071 $ hg mv f3a f3e
1057 $ hg mv f4a f4e
1072 $ hg mv f4a f4e
1058 $ hg mv f5a f5b
1073 $ hg mv f5a f5b
1059 $ hg ci -qAm "E0"
1074 $ hg ci -qAm "E0"
1060 $ hg log -G
1075 $ hg log -G
1061 @ changeset: 6:6bd1736cab86
1076 @ changeset: 6:6bd1736cab86
1062 | tag: tip
1077 | tag: tip
1063 | parent: 0:11f7a1b56675
1078 | parent: 0:11f7a1b56675
1064 | user: test
1079 | user: test
1065 | date: Thu Jan 01 00:00:00 1970 +0000
1080 | date: Thu Jan 01 00:00:00 1970 +0000
1066 | summary: E0
1081 | summary: E0
1067 |
1082 |
1068 | o changeset: 5:560daee679da
1083 | o changeset: 5:560daee679da
1069 | | user: test
1084 | | user: test
1070 | | date: Thu Jan 01 00:00:00 1970 +0000
1085 | | date: Thu Jan 01 00:00:00 1970 +0000
1071 | | summary: D1
1086 | | summary: D1
1072 | |
1087 | |
1073 | o changeset: 4:c9763722f9bd
1088 | o changeset: 4:c9763722f9bd
1074 |/ parent: 0:11f7a1b56675
1089 |/ parent: 0:11f7a1b56675
1075 | user: test
1090 | user: test
1076 | date: Thu Jan 01 00:00:00 1970 +0000
1091 | date: Thu Jan 01 00:00:00 1970 +0000
1077 | summary: C1
1092 | summary: C1
1078 |
1093 |
1079 | o changeset: 3:b69f5839d2d9
1094 | o changeset: 3:b69f5839d2d9
1080 | | user: test
1095 | | user: test
1081 | | date: Thu Jan 01 00:00:00 1970 +0000
1096 | | date: Thu Jan 01 00:00:00 1970 +0000
1082 | | summary: D0
1097 | | summary: D0
1083 | |
1098 | |
1084 | o changeset: 2:f58c7e2b28fa
1099 | o changeset: 2:f58c7e2b28fa
1085 | | user: test
1100 | | user: test
1086 | | date: Thu Jan 01 00:00:00 1970 +0000
1101 | | date: Thu Jan 01 00:00:00 1970 +0000
1087 | | summary: C0
1102 | | summary: C0
1088 | |
1103 | |
1089 | o changeset: 1:3d7bba921b5d
1104 | o changeset: 1:3d7bba921b5d
1090 |/ user: test
1105 |/ user: test
1091 | date: Thu Jan 01 00:00:00 1970 +0000
1106 | date: Thu Jan 01 00:00:00 1970 +0000
1092 | summary: B0
1107 | summary: B0
1093 |
1108 |
1094 o changeset: 0:11f7a1b56675
1109 o changeset: 0:11f7a1b56675
1095 user: test
1110 user: test
1096 date: Thu Jan 01 00:00:00 1970 +0000
1111 date: Thu Jan 01 00:00:00 1970 +0000
1097 summary: A0
1112 summary: A0
1098
1113
1099
1114
1100 Test the cases A.4 (f1x), the "ping-pong" special case of A.7 (f5x),
1115 Test the cases A.4 (f1x), the "ping-pong" special case of A.7 (f5x),
1101 and A.3 with a local content change to be preserved (f2x).
1116 and A.3 with a local content change to be preserved (f2x).
1102
1117
1103 $ HGEDITOR="echo C2 >" hg graft -r 'desc("C0")' --edit
1118 $ HGEDITOR="echo C2 >" hg graft -r 'desc("C0")' --edit
1104 grafting 2:f58c7e2b28fa "C0"
1119 grafting 2:f58c7e2b28fa "C0"
1105 merging f1e and f1b to f1e
1120 merging f1e and f1b to f1e
1106 merging f2a and f2c to f2c
1121 merging f2a and f2c to f2c
1107 merging f5b and f5a to f5a
1122 merging f5b and f5a to f5a
1108
1123
1109 Test the cases A.1 (f4x) and A.7 (f3x).
1124 Test the cases A.1 (f4x) and A.7 (f3x).
1110
1125
1111 $ HGEDITOR="echo D2 >" hg graft -r 'desc("D0")' --edit
1126 $ HGEDITOR="echo D2 >" hg graft -r 'desc("D0")' --edit
1112 grafting 3:b69f5839d2d9 "D0"
1127 grafting 3:b69f5839d2d9 "D0"
1113 note: possible conflict - f3b was renamed multiple times to:
1128 note: possible conflict - f3b was renamed multiple times to:
1114 f3e
1129 f3e
1115 f3d
1130 f3d
1116 merging f4e and f4a to f4e
1131 merging f4e and f4a to f4e
1117 warning: can't find ancestor for 'f3d' copied from 'f3b'!
1132 warning: can't find ancestor for 'f3d' copied from 'f3b'!
1118
1133
1119 Check the results of the grafts tested
1134 Check the results of the grafts tested
1120
1135
1121 $ hg log -CGv --patch --git
1136 $ hg log -CGv --patch --git
1122 @ changeset: 8:93ee502e8b0a
1137 @ changeset: 8:93ee502e8b0a
1123 | tag: tip
1138 | tag: tip
1124 | user: test
1139 | user: test
1125 | date: Thu Jan 01 00:00:00 1970 +0000
1140 | date: Thu Jan 01 00:00:00 1970 +0000
1126 | files: f3d f4e
1141 | files: f3d f4e
1127 | description:
1142 | description:
1128 | D2
1143 | D2
1129 |
1144 |
1130 |
1145 |
1131 | diff --git a/f3d b/f3d
1146 | diff --git a/f3d b/f3d
1132 | new file mode 100644
1147 | new file mode 100644
1133 | --- /dev/null
1148 | --- /dev/null
1134 | +++ b/f3d
1149 | +++ b/f3d
1135 | @@ -0,0 +1,1 @@
1150 | @@ -0,0 +1,1 @@
1136 | +c3a
1151 | +c3a
1137 | diff --git a/f4e b/f4e
1152 | diff --git a/f4e b/f4e
1138 | --- a/f4e
1153 | --- a/f4e
1139 | +++ b/f4e
1154 | +++ b/f4e
1140 | @@ -1,1 +1,1 @@
1155 | @@ -1,1 +1,1 @@
1141 | -c4a
1156 | -c4a
1142 | +c4d
1157 | +c4d
1143 |
1158 |
1144 o changeset: 7:539cf145f496
1159 o changeset: 7:539cf145f496
1145 | user: test
1160 | user: test
1146 | date: Thu Jan 01 00:00:00 1970 +0000
1161 | date: Thu Jan 01 00:00:00 1970 +0000
1147 | files: f1e f2a f2c f5a f5b
1162 | files: f1e f2a f2c f5a f5b
1148 | copies: f2c (f2a) f5a (f5b)
1163 | copies: f2c (f2a) f5a (f5b)
1149 | description:
1164 | description:
1150 | C2
1165 | C2
1151 |
1166 |
1152 |
1167 |
1153 | diff --git a/f1e b/f1e
1168 | diff --git a/f1e b/f1e
1154 | --- a/f1e
1169 | --- a/f1e
1155 | +++ b/f1e
1170 | +++ b/f1e
1156 | @@ -1,1 +1,1 @@
1171 | @@ -1,1 +1,1 @@
1157 | -c1a
1172 | -c1a
1158 | +c1c
1173 | +c1c
1159 | diff --git a/f2a b/f2c
1174 | diff --git a/f2a b/f2c
1160 | rename from f2a
1175 | rename from f2a
1161 | rename to f2c
1176 | rename to f2c
1162 | diff --git a/f5b b/f5a
1177 | diff --git a/f5b b/f5a
1163 | rename from f5b
1178 | rename from f5b
1164 | rename to f5a
1179 | rename to f5a
1165 | --- a/f5b
1180 | --- a/f5b
1166 | +++ b/f5a
1181 | +++ b/f5a
1167 | @@ -1,1 +1,1 @@
1182 | @@ -1,1 +1,1 @@
1168 | -c5a
1183 | -c5a
1169 | +c5c
1184 | +c5c
1170 |
1185 |
1171 o changeset: 6:6bd1736cab86
1186 o changeset: 6:6bd1736cab86
1172 | parent: 0:11f7a1b56675
1187 | parent: 0:11f7a1b56675
1173 | user: test
1188 | user: test
1174 | date: Thu Jan 01 00:00:00 1970 +0000
1189 | date: Thu Jan 01 00:00:00 1970 +0000
1175 | files: f1a f1e f2a f3a f3e f4a f4e f5a f5b
1190 | files: f1a f1e f2a f3a f3e f4a f4e f5a f5b
1176 | copies: f1e (f1a) f3e (f3a) f4e (f4a) f5b (f5a)
1191 | copies: f1e (f1a) f3e (f3a) f4e (f4a) f5b (f5a)
1177 | description:
1192 | description:
1178 | E0
1193 | E0
1179 |
1194 |
1180 |
1195 |
1181 | diff --git a/f1a b/f1e
1196 | diff --git a/f1a b/f1e
1182 | rename from f1a
1197 | rename from f1a
1183 | rename to f1e
1198 | rename to f1e
1184 | diff --git a/f2a b/f2a
1199 | diff --git a/f2a b/f2a
1185 | --- a/f2a
1200 | --- a/f2a
1186 | +++ b/f2a
1201 | +++ b/f2a
1187 | @@ -1,1 +1,1 @@
1202 | @@ -1,1 +1,1 @@
1188 | -c2a
1203 | -c2a
1189 | +c2e
1204 | +c2e
1190 | diff --git a/f3a b/f3e
1205 | diff --git a/f3a b/f3e
1191 | rename from f3a
1206 | rename from f3a
1192 | rename to f3e
1207 | rename to f3e
1193 | diff --git a/f4a b/f4e
1208 | diff --git a/f4a b/f4e
1194 | rename from f4a
1209 | rename from f4a
1195 | rename to f4e
1210 | rename to f4e
1196 | diff --git a/f5a b/f5b
1211 | diff --git a/f5a b/f5b
1197 | rename from f5a
1212 | rename from f5a
1198 | rename to f5b
1213 | rename to f5b
1199 |
1214 |
1200 | o changeset: 5:560daee679da
1215 | o changeset: 5:560daee679da
1201 | | user: test
1216 | | user: test
1202 | | date: Thu Jan 01 00:00:00 1970 +0000
1217 | | date: Thu Jan 01 00:00:00 1970 +0000
1203 | | files: f3d f4a
1218 | | files: f3d f4a
1204 | | description:
1219 | | description:
1205 | | D1
1220 | | D1
1206 | |
1221 | |
1207 | |
1222 | |
1208 | | diff --git a/f3d b/f3d
1223 | | diff --git a/f3d b/f3d
1209 | | new file mode 100644
1224 | | new file mode 100644
1210 | | --- /dev/null
1225 | | --- /dev/null
1211 | | +++ b/f3d
1226 | | +++ b/f3d
1212 | | @@ -0,0 +1,1 @@
1227 | | @@ -0,0 +1,1 @@
1213 | | +c3a
1228 | | +c3a
1214 | | diff --git a/f4a b/f4a
1229 | | diff --git a/f4a b/f4a
1215 | | --- a/f4a
1230 | | --- a/f4a
1216 | | +++ b/f4a
1231 | | +++ b/f4a
1217 | | @@ -1,1 +1,1 @@
1232 | | @@ -1,1 +1,1 @@
1218 | | -c4a
1233 | | -c4a
1219 | | +c4d
1234 | | +c4d
1220 | |
1235 | |
1221 | o changeset: 4:c9763722f9bd
1236 | o changeset: 4:c9763722f9bd
1222 |/ parent: 0:11f7a1b56675
1237 |/ parent: 0:11f7a1b56675
1223 | user: test
1238 | user: test
1224 | date: Thu Jan 01 00:00:00 1970 +0000
1239 | date: Thu Jan 01 00:00:00 1970 +0000
1225 | files: f1a f2a f2c f5a
1240 | files: f1a f2a f2c f5a
1226 | copies: f2c (f2a)
1241 | copies: f2c (f2a)
1227 | description:
1242 | description:
1228 | C1
1243 | C1
1229 |
1244 |
1230 |
1245 |
1231 | diff --git a/f1a b/f1a
1246 | diff --git a/f1a b/f1a
1232 | --- a/f1a
1247 | --- a/f1a
1233 | +++ b/f1a
1248 | +++ b/f1a
1234 | @@ -1,1 +1,1 @@
1249 | @@ -1,1 +1,1 @@
1235 | -c1a
1250 | -c1a
1236 | +c1c
1251 | +c1c
1237 | diff --git a/f2a b/f2c
1252 | diff --git a/f2a b/f2c
1238 | rename from f2a
1253 | rename from f2a
1239 | rename to f2c
1254 | rename to f2c
1240 | diff --git a/f5a b/f5a
1255 | diff --git a/f5a b/f5a
1241 | --- a/f5a
1256 | --- a/f5a
1242 | +++ b/f5a
1257 | +++ b/f5a
1243 | @@ -1,1 +1,1 @@
1258 | @@ -1,1 +1,1 @@
1244 | -c5a
1259 | -c5a
1245 | +c5c
1260 | +c5c
1246 |
1261 |
1247 | o changeset: 3:b69f5839d2d9
1262 | o changeset: 3:b69f5839d2d9
1248 | | user: test
1263 | | user: test
1249 | | date: Thu Jan 01 00:00:00 1970 +0000
1264 | | date: Thu Jan 01 00:00:00 1970 +0000
1250 | | files: f3b f3d f4a
1265 | | files: f3b f3d f4a
1251 | | copies: f3d (f3b)
1266 | | copies: f3d (f3b)
1252 | | description:
1267 | | description:
1253 | | D0
1268 | | D0
1254 | |
1269 | |
1255 | |
1270 | |
1256 | | diff --git a/f3b b/f3d
1271 | | diff --git a/f3b b/f3d
1257 | | rename from f3b
1272 | | rename from f3b
1258 | | rename to f3d
1273 | | rename to f3d
1259 | | diff --git a/f4a b/f4a
1274 | | diff --git a/f4a b/f4a
1260 | | --- a/f4a
1275 | | --- a/f4a
1261 | | +++ b/f4a
1276 | | +++ b/f4a
1262 | | @@ -1,1 +1,1 @@
1277 | | @@ -1,1 +1,1 @@
1263 | | -c4a
1278 | | -c4a
1264 | | +c4d
1279 | | +c4d
1265 | |
1280 | |
1266 | o changeset: 2:f58c7e2b28fa
1281 | o changeset: 2:f58c7e2b28fa
1267 | | user: test
1282 | | user: test
1268 | | date: Thu Jan 01 00:00:00 1970 +0000
1283 | | date: Thu Jan 01 00:00:00 1970 +0000
1269 | | files: f1b f2a f2c f5a f5b
1284 | | files: f1b f2a f2c f5a f5b
1270 | | copies: f2c (f2a) f5a (f5b)
1285 | | copies: f2c (f2a) f5a (f5b)
1271 | | description:
1286 | | description:
1272 | | C0
1287 | | C0
1273 | |
1288 | |
1274 | |
1289 | |
1275 | | diff --git a/f1b b/f1b
1290 | | diff --git a/f1b b/f1b
1276 | | --- a/f1b
1291 | | --- a/f1b
1277 | | +++ b/f1b
1292 | | +++ b/f1b
1278 | | @@ -1,1 +1,1 @@
1293 | | @@ -1,1 +1,1 @@
1279 | | -c1a
1294 | | -c1a
1280 | | +c1c
1295 | | +c1c
1281 | | diff --git a/f2a b/f2c
1296 | | diff --git a/f2a b/f2c
1282 | | rename from f2a
1297 | | rename from f2a
1283 | | rename to f2c
1298 | | rename to f2c
1284 | | diff --git a/f5b b/f5a
1299 | | diff --git a/f5b b/f5a
1285 | | rename from f5b
1300 | | rename from f5b
1286 | | rename to f5a
1301 | | rename to f5a
1287 | | --- a/f5b
1302 | | --- a/f5b
1288 | | +++ b/f5a
1303 | | +++ b/f5a
1289 | | @@ -1,1 +1,1 @@
1304 | | @@ -1,1 +1,1 @@
1290 | | -c5a
1305 | | -c5a
1291 | | +c5c
1306 | | +c5c
1292 | |
1307 | |
1293 | o changeset: 1:3d7bba921b5d
1308 | o changeset: 1:3d7bba921b5d
1294 |/ user: test
1309 |/ user: test
1295 | date: Thu Jan 01 00:00:00 1970 +0000
1310 | date: Thu Jan 01 00:00:00 1970 +0000
1296 | files: f1a f1b f3a f3b f5a f5b
1311 | files: f1a f1b f3a f3b f5a f5b
1297 | copies: f1b (f1a) f3b (f3a) f5b (f5a)
1312 | copies: f1b (f1a) f3b (f3a) f5b (f5a)
1298 | description:
1313 | description:
1299 | B0
1314 | B0
1300 |
1315 |
1301 |
1316 |
1302 | diff --git a/f1a b/f1b
1317 | diff --git a/f1a b/f1b
1303 | rename from f1a
1318 | rename from f1a
1304 | rename to f1b
1319 | rename to f1b
1305 | diff --git a/f3a b/f3b
1320 | diff --git a/f3a b/f3b
1306 | rename from f3a
1321 | rename from f3a
1307 | rename to f3b
1322 | rename to f3b
1308 | diff --git a/f5a b/f5b
1323 | diff --git a/f5a b/f5b
1309 | rename from f5a
1324 | rename from f5a
1310 | rename to f5b
1325 | rename to f5b
1311 |
1326 |
1312 o changeset: 0:11f7a1b56675
1327 o changeset: 0:11f7a1b56675
1313 user: test
1328 user: test
1314 date: Thu Jan 01 00:00:00 1970 +0000
1329 date: Thu Jan 01 00:00:00 1970 +0000
1315 files: f1a f2a f3a f4a f5a
1330 files: f1a f2a f3a f4a f5a
1316 description:
1331 description:
1317 A0
1332 A0
1318
1333
1319
1334
1320 diff --git a/f1a b/f1a
1335 diff --git a/f1a b/f1a
1321 new file mode 100644
1336 new file mode 100644
1322 --- /dev/null
1337 --- /dev/null
1323 +++ b/f1a
1338 +++ b/f1a
1324 @@ -0,0 +1,1 @@
1339 @@ -0,0 +1,1 @@
1325 +c1a
1340 +c1a
1326 diff --git a/f2a b/f2a
1341 diff --git a/f2a b/f2a
1327 new file mode 100644
1342 new file mode 100644
1328 --- /dev/null
1343 --- /dev/null
1329 +++ b/f2a
1344 +++ b/f2a
1330 @@ -0,0 +1,1 @@
1345 @@ -0,0 +1,1 @@
1331 +c2a
1346 +c2a
1332 diff --git a/f3a b/f3a
1347 diff --git a/f3a b/f3a
1333 new file mode 100644
1348 new file mode 100644
1334 --- /dev/null
1349 --- /dev/null
1335 +++ b/f3a
1350 +++ b/f3a
1336 @@ -0,0 +1,1 @@
1351 @@ -0,0 +1,1 @@
1337 +c3a
1352 +c3a
1338 diff --git a/f4a b/f4a
1353 diff --git a/f4a b/f4a
1339 new file mode 100644
1354 new file mode 100644
1340 --- /dev/null
1355 --- /dev/null
1341 +++ b/f4a
1356 +++ b/f4a
1342 @@ -0,0 +1,1 @@
1357 @@ -0,0 +1,1 @@
1343 +c4a
1358 +c4a
1344 diff --git a/f5a b/f5a
1359 diff --git a/f5a b/f5a
1345 new file mode 100644
1360 new file mode 100644
1346 --- /dev/null
1361 --- /dev/null
1347 +++ b/f5a
1362 +++ b/f5a
1348 @@ -0,0 +1,1 @@
1363 @@ -0,0 +1,1 @@
1349 +c5a
1364 +c5a
1350
1365
1351 $ hg cat f2c
1366 $ hg cat f2c
1352 c2e
1367 c2e
1353
1368
1354 Check superfluous filemerge of files renamed in the past but untouched by graft
1369 Check superfluous filemerge of files renamed in the past but untouched by graft
1355
1370
1356 $ echo a > a
1371 $ echo a > a
1357 $ hg ci -qAma
1372 $ hg ci -qAma
1358 $ hg mv a b
1373 $ hg mv a b
1359 $ echo b > b
1374 $ echo b > b
1360 $ hg ci -qAmb
1375 $ hg ci -qAmb
1361 $ echo c > c
1376 $ echo c > c
1362 $ hg ci -qAmc
1377 $ hg ci -qAmc
1363 $ hg up -q .~2
1378 $ hg up -q .~2
1364 $ hg graft tip -qt:fail
1379 $ hg graft tip -qt:fail
1365
1380
1366 $ cd ..
1381 $ cd ..
1367
1382
1368 Graft a change into a new file previously grafted into a renamed directory
1383 Graft a change into a new file previously grafted into a renamed directory
1369
1384
1370 $ hg init dirmovenewfile
1385 $ hg init dirmovenewfile
1371 $ cd dirmovenewfile
1386 $ cd dirmovenewfile
1372 $ mkdir a
1387 $ mkdir a
1373 $ echo a > a/a
1388 $ echo a > a/a
1374 $ hg ci -qAma
1389 $ hg ci -qAma
1375 $ echo x > a/x
1390 $ echo x > a/x
1376 $ hg ci -qAmx
1391 $ hg ci -qAmx
1377 $ hg up -q 0
1392 $ hg up -q 0
1378 $ hg mv -q a b
1393 $ hg mv -q a b
1379 $ hg ci -qAmb
1394 $ hg ci -qAmb
1380 $ hg graft -q 1 # a/x grafted as b/x, but no copy information recorded
1395 $ hg graft -q 1 # a/x grafted as b/x, but no copy information recorded
1381 $ hg up -q 1
1396 $ hg up -q 1
1382 $ echo y > a/x
1397 $ echo y > a/x
1383 $ hg ci -qAmy
1398 $ hg ci -qAmy
1384 $ hg up -q 3
1399 $ hg up -q 3
1385 $ hg graft -q 4
1400 $ hg graft -q 4
1386 $ hg status --change .
1401 $ hg status --change .
1387 M b/x
1402 M b/x
1388
1403
1389 Prepare for test of skipped changesets and how merges can influence it:
1404 Prepare for test of skipped changesets and how merges can influence it:
1390
1405
1391 $ hg merge -q -r 1 --tool :local
1406 $ hg merge -q -r 1 --tool :local
1392 $ hg ci -m m
1407 $ hg ci -m m
1393 $ echo xx >> b/x
1408 $ echo xx >> b/x
1394 $ hg ci -m xx
1409 $ hg ci -m xx
1395
1410
1396 $ hg log -G -T '{rev} {desc|firstline}'
1411 $ hg log -G -T '{rev} {desc|firstline}'
1397 @ 7 xx
1412 @ 7 xx
1398 |
1413 |
1399 o 6 m
1414 o 6 m
1400 |\
1415 |\
1401 | o 5 y
1416 | o 5 y
1402 | |
1417 | |
1403 +---o 4 y
1418 +---o 4 y
1404 | |
1419 | |
1405 | o 3 x
1420 | o 3 x
1406 | |
1421 | |
1407 | o 2 b
1422 | o 2 b
1408 | |
1423 | |
1409 o | 1 x
1424 o | 1 x
1410 |/
1425 |/
1411 o 0 a
1426 o 0 a
1412
1427
1413 Grafting of plain changes correctly detects that 3 and 5 should be skipped:
1428 Grafting of plain changes correctly detects that 3 and 5 should be skipped:
1414
1429
1415 $ hg up -qCr 4
1430 $ hg up -qCr 4
1416 $ hg graft --tool :local -r 2::5
1431 $ hg graft --tool :local -r 2::5
1417 skipping already grafted revision 3:ca093ca2f1d9 (was grafted from 1:13ec5badbf2a)
1432 skipping already grafted revision 3:ca093ca2f1d9 (was grafted from 1:13ec5badbf2a)
1418 skipping already grafted revision 5:43e9eb70dab0 (was grafted from 4:6c9a1289e5f1)
1433 skipping already grafted revision 5:43e9eb70dab0 (was grafted from 4:6c9a1289e5f1)
1419 grafting 2:42127f193bcd "b"
1434 grafting 2:42127f193bcd "b"
1420
1435
1421 Extending the graft range to include a (skipped) merge of 3 will not prevent us from
1436 Extending the graft range to include a (skipped) merge of 3 will not prevent us from
1422 also detecting that both 3 and 5 should be skipped:
1437 also detecting that both 3 and 5 should be skipped:
1423
1438
1424 $ hg up -qCr 4
1439 $ hg up -qCr 4
1425 $ hg graft --tool :local -r 2::7
1440 $ hg graft --tool :local -r 2::7
1426 skipping ungraftable merge revision 6
1441 skipping ungraftable merge revision 6
1427 skipping already grafted revision 3:ca093ca2f1d9 (was grafted from 1:13ec5badbf2a)
1442 skipping already grafted revision 3:ca093ca2f1d9 (was grafted from 1:13ec5badbf2a)
1428 skipping already grafted revision 5:43e9eb70dab0 (was grafted from 4:6c9a1289e5f1)
1443 skipping already grafted revision 5:43e9eb70dab0 (was grafted from 4:6c9a1289e5f1)
1429 grafting 2:42127f193bcd "b"
1444 grafting 2:42127f193bcd "b"
1430 grafting 7:d3c3f2b38ecc "xx"
1445 grafting 7:d3c3f2b38ecc "xx"
1431 note: graft of 7:d3c3f2b38ecc created no changes to commit
1446 note: graft of 7:d3c3f2b38ecc created no changes to commit
1432
1447
1433 $ cd ..
1448 $ cd ..
1434
1449
1435 Grafted revision should be warned and skipped only once. (issue6024)
1450 Grafted revision should be warned and skipped only once. (issue6024)
1436
1451
1437 $ mkdir issue6024
1452 $ mkdir issue6024
1438 $ cd issue6024
1453 $ cd issue6024
1439
1454
1440 $ hg init base
1455 $ hg init base
1441 $ cd base
1456 $ cd base
1442 $ touch x
1457 $ touch x
1443 $ hg commit -qAminit
1458 $ hg commit -qAminit
1444 $ echo a > x
1459 $ echo a > x
1445 $ hg commit -mchange
1460 $ hg commit -mchange
1446 $ hg update -q 0
1461 $ hg update -q 0
1447 $ hg graft -r 1
1462 $ hg graft -r 1
1448 grafting 1:a0b923c546aa "change" (tip)
1463 grafting 1:a0b923c546aa "change" (tip)
1449 $ cd ..
1464 $ cd ..
1450
1465
1451 $ hg clone -qr 2 base clone
1466 $ hg clone -qr 2 base clone
1452 $ cd clone
1467 $ cd clone
1453 $ hg pull -q
1468 $ hg pull -q
1454 $ hg merge -q 2
1469 $ hg merge -q 2
1455 $ hg commit -mmerge
1470 $ hg commit -mmerge
1456 $ hg update -q 0
1471 $ hg update -q 0
1457 $ hg graft -r 1
1472 $ hg graft -r 1
1458 grafting 1:04fc6d444368 "change"
1473 grafting 1:04fc6d444368 "change"
1459 $ hg update -q 3
1474 $ hg update -q 3
1460 $ hg log -G -T '{rev}:{node|shortest} <- {extras.source|shortest}\n'
1475 $ hg log -G -T '{rev}:{node|shortest} <- {extras.source|shortest}\n'
1461 o 4:4e16 <- a0b9
1476 o 4:4e16 <- a0b9
1462 |
1477 |
1463 | @ 3:f0ac <-
1478 | @ 3:f0ac <-
1464 | |\
1479 | |\
1465 +---o 2:a0b9 <-
1480 +---o 2:a0b9 <-
1466 | |
1481 | |
1467 | o 1:04fc <- a0b9
1482 | o 1:04fc <- a0b9
1468 |/
1483 |/
1469 o 0:7848 <-
1484 o 0:7848 <-
1470
1485
1471
1486
1472 the source of rev 4 is an ancestor of the working parent, and was also
1487 the source of rev 4 is an ancestor of the working parent, and was also
1473 grafted as rev 1. it should be stripped from the target revisions only once.
1488 grafted as rev 1. it should be stripped from the target revisions only once.
1474
1489
1475 $ hg graft -r 4
1490 $ hg graft -r 4
1476 skipping already grafted revision 4:4e16bab40c9c (1:04fc6d444368 also has origin 2:a0b923c546aa)
1491 skipping already grafted revision 4:4e16bab40c9c (1:04fc6d444368 also has origin 2:a0b923c546aa)
1477 [255]
1492 [255]
1478
1493
1479 $ cd ../..
1494 $ cd ../..
1480
1495
1481 Testing the reading of old format graftstate file with newer mercurial
1496 Testing the reading of old format graftstate file with newer mercurial
1482
1497
1483 $ hg init oldgraft
1498 $ hg init oldgraft
1484 $ cd oldgraft
1499 $ cd oldgraft
1485 $ for ch in a b c; do echo foo > $ch; hg add $ch; hg ci -Aqm "added "$ch; done;
1500 $ for ch in a b c; do echo foo > $ch; hg add $ch; hg ci -Aqm "added "$ch; done;
1486 $ hg log -GT "{rev}:{node|short} {desc}\n"
1501 $ hg log -GT "{rev}:{node|short} {desc}\n"
1487 @ 2:8be98ac1a569 added c
1502 @ 2:8be98ac1a569 added c
1488 |
1503 |
1489 o 1:80e6d2c47cfe added b
1504 o 1:80e6d2c47cfe added b
1490 |
1505 |
1491 o 0:f7ad41964313 added a
1506 o 0:f7ad41964313 added a
1492
1507
1493 $ hg up 0
1508 $ hg up 0
1494 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
1509 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
1495 $ echo bar > b
1510 $ echo bar > b
1496 $ hg add b
1511 $ hg add b
1497 $ hg ci -m "bar to b"
1512 $ hg ci -m "bar to b"
1498 created new head
1513 created new head
1499 $ hg graft -r 1 -r 2
1514 $ hg graft -r 1 -r 2
1500 grafting 1:80e6d2c47cfe "added b"
1515 grafting 1:80e6d2c47cfe "added b"
1501 merging b
1516 merging b
1502 warning: conflicts while merging b! (edit, then use 'hg resolve --mark')
1517 warning: conflicts while merging b! (edit, then use 'hg resolve --mark')
1503 abort: unresolved conflicts, can't continue
1518 abort: unresolved conflicts, can't continue
1504 (use 'hg resolve' and 'hg graft --continue')
1519 (use 'hg resolve' and 'hg graft --continue')
1505 [255]
1520 [255]
1506
1521
1507 Writing the nodes in old format to graftstate
1522 Writing the nodes in old format to graftstate
1508
1523
1509 $ hg log -r 1 -r 2 -T '{node}\n' > .hg/graftstate
1524 $ hg log -r 1 -r 2 -T '{node}\n' > .hg/graftstate
1510 $ echo foo > b
1525 $ echo foo > b
1511 $ hg resolve -m
1526 $ hg resolve -m
1512 (no more unresolved files)
1527 (no more unresolved files)
1513 continue: hg graft --continue
1528 continue: hg graft --continue
1514 $ hg graft --continue
1529 $ hg graft --continue
1515 grafting 1:80e6d2c47cfe "added b"
1530 grafting 1:80e6d2c47cfe "added b"
1516 grafting 2:8be98ac1a569 "added c"
1531 grafting 2:8be98ac1a569 "added c"
1517
1532
1518 Testing that --user is preserved during conflicts and value is reused while
1533 Testing that --user is preserved during conflicts and value is reused while
1519 running `hg graft --continue`
1534 running `hg graft --continue`
1520
1535
1521 $ hg log -G
1536 $ hg log -G
1522 @ changeset: 5:711e9fa999f1
1537 @ changeset: 5:711e9fa999f1
1523 | tag: tip
1538 | tag: tip
1524 | user: test
1539 | user: test
1525 | date: Thu Jan 01 00:00:00 1970 +0000
1540 | date: Thu Jan 01 00:00:00 1970 +0000
1526 | summary: added c
1541 | summary: added c
1527 |
1542 |
1528 o changeset: 4:e5ad7353b408
1543 o changeset: 4:e5ad7353b408
1529 | user: test
1544 | user: test
1530 | date: Thu Jan 01 00:00:00 1970 +0000
1545 | date: Thu Jan 01 00:00:00 1970 +0000
1531 | summary: added b
1546 | summary: added b
1532 |
1547 |
1533 o changeset: 3:9e887f7a939c
1548 o changeset: 3:9e887f7a939c
1534 | parent: 0:f7ad41964313
1549 | parent: 0:f7ad41964313
1535 | user: test
1550 | user: test
1536 | date: Thu Jan 01 00:00:00 1970 +0000
1551 | date: Thu Jan 01 00:00:00 1970 +0000
1537 | summary: bar to b
1552 | summary: bar to b
1538 |
1553 |
1539 | o changeset: 2:8be98ac1a569
1554 | o changeset: 2:8be98ac1a569
1540 | | user: test
1555 | | user: test
1541 | | date: Thu Jan 01 00:00:00 1970 +0000
1556 | | date: Thu Jan 01 00:00:00 1970 +0000
1542 | | summary: added c
1557 | | summary: added c
1543 | |
1558 | |
1544 | o changeset: 1:80e6d2c47cfe
1559 | o changeset: 1:80e6d2c47cfe
1545 |/ user: test
1560 |/ user: test
1546 | date: Thu Jan 01 00:00:00 1970 +0000
1561 | date: Thu Jan 01 00:00:00 1970 +0000
1547 | summary: added b
1562 | summary: added b
1548 |
1563 |
1549 o changeset: 0:f7ad41964313
1564 o changeset: 0:f7ad41964313
1550 user: test
1565 user: test
1551 date: Thu Jan 01 00:00:00 1970 +0000
1566 date: Thu Jan 01 00:00:00 1970 +0000
1552 summary: added a
1567 summary: added a
1553
1568
1554
1569
1555 $ hg up '.^^'
1570 $ hg up '.^^'
1556 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
1571 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
1557
1572
1558 $ hg graft -r 1 -r 2 --user batman
1573 $ hg graft -r 1 -r 2 --user batman
1559 grafting 1:80e6d2c47cfe "added b"
1574 grafting 1:80e6d2c47cfe "added b"
1560 merging b
1575 merging b
1561 warning: conflicts while merging b! (edit, then use 'hg resolve --mark')
1576 warning: conflicts while merging b! (edit, then use 'hg resolve --mark')
1562 abort: unresolved conflicts, can't continue
1577 abort: unresolved conflicts, can't continue
1563 (use 'hg resolve' and 'hg graft --continue')
1578 (use 'hg resolve' and 'hg graft --continue')
1564 [255]
1579 [255]
1565
1580
1566 $ echo wat > b
1581 $ echo wat > b
1567 $ hg resolve -m
1582 $ hg resolve -m
1568 (no more unresolved files)
1583 (no more unresolved files)
1569 continue: hg graft --continue
1584 continue: hg graft --continue
1570
1585
1571 $ hg graft --continue
1586 $ hg graft --continue
1572 grafting 1:80e6d2c47cfe "added b"
1587 grafting 1:80e6d2c47cfe "added b"
1573 grafting 2:8be98ac1a569 "added c"
1588 grafting 2:8be98ac1a569 "added c"
1574
1589
1575 $ hg log -Gr 3::
1590 $ hg log -Gr 3::
1576 @ changeset: 7:11a36ffaacf2
1591 @ changeset: 7:11a36ffaacf2
1577 | tag: tip
1592 | tag: tip
1578 | user: batman
1593 | user: batman
1579 | date: Thu Jan 01 00:00:00 1970 +0000
1594 | date: Thu Jan 01 00:00:00 1970 +0000
1580 | summary: added c
1595 | summary: added c
1581 |
1596 |
1582 o changeset: 6:76803afc6511
1597 o changeset: 6:76803afc6511
1583 | parent: 3:9e887f7a939c
1598 | parent: 3:9e887f7a939c
1584 | user: batman
1599 | user: batman
1585 | date: Thu Jan 01 00:00:00 1970 +0000
1600 | date: Thu Jan 01 00:00:00 1970 +0000
1586 | summary: added b
1601 | summary: added b
1587 |
1602 |
1588 | o changeset: 5:711e9fa999f1
1603 | o changeset: 5:711e9fa999f1
1589 | | user: test
1604 | | user: test
1590 | | date: Thu Jan 01 00:00:00 1970 +0000
1605 | | date: Thu Jan 01 00:00:00 1970 +0000
1591 | | summary: added c
1606 | | summary: added c
1592 | |
1607 | |
1593 | o changeset: 4:e5ad7353b408
1608 | o changeset: 4:e5ad7353b408
1594 |/ user: test
1609 |/ user: test
1595 | date: Thu Jan 01 00:00:00 1970 +0000
1610 | date: Thu Jan 01 00:00:00 1970 +0000
1596 | summary: added b
1611 | summary: added b
1597 |
1612 |
1598 o changeset: 3:9e887f7a939c
1613 o changeset: 3:9e887f7a939c
1599 | parent: 0:f7ad41964313
1614 | parent: 0:f7ad41964313
1600 ~ user: test
1615 ~ user: test
1601 date: Thu Jan 01 00:00:00 1970 +0000
1616 date: Thu Jan 01 00:00:00 1970 +0000
1602 summary: bar to b
1617 summary: bar to b
1603
1618
1604 Test that --date is preserved and reused in `hg graft --continue`
1619 Test that --date is preserved and reused in `hg graft --continue`
1605
1620
1606 $ hg up '.^^'
1621 $ hg up '.^^'
1607 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
1622 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
1608 $ hg graft -r 1 -r 2 --date '1234560000 120'
1623 $ hg graft -r 1 -r 2 --date '1234560000 120'
1609 grafting 1:80e6d2c47cfe "added b"
1624 grafting 1:80e6d2c47cfe "added b"
1610 merging b
1625 merging b
1611 warning: conflicts while merging b! (edit, then use 'hg resolve --mark')
1626 warning: conflicts while merging b! (edit, then use 'hg resolve --mark')
1612 abort: unresolved conflicts, can't continue
1627 abort: unresolved conflicts, can't continue
1613 (use 'hg resolve' and 'hg graft --continue')
1628 (use 'hg resolve' and 'hg graft --continue')
1614 [255]
1629 [255]
1615
1630
1616 $ echo foobar > b
1631 $ echo foobar > b
1617 $ hg resolve -m
1632 $ hg resolve -m
1618 (no more unresolved files)
1633 (no more unresolved files)
1619 continue: hg graft --continue
1634 continue: hg graft --continue
1620 $ hg graft --continue
1635 $ hg graft --continue
1621 grafting 1:80e6d2c47cfe "added b"
1636 grafting 1:80e6d2c47cfe "added b"
1622 grafting 2:8be98ac1a569 "added c"
1637 grafting 2:8be98ac1a569 "added c"
1623
1638
1624 $ hg log -Gr '.^^::.'
1639 $ hg log -Gr '.^^::.'
1625 @ changeset: 9:1896b76e007a
1640 @ changeset: 9:1896b76e007a
1626 | tag: tip
1641 | tag: tip
1627 | user: test
1642 | user: test
1628 | date: Fri Feb 13 21:18:00 2009 -0002
1643 | date: Fri Feb 13 21:18:00 2009 -0002
1629 | summary: added c
1644 | summary: added c
1630 |
1645 |
1631 o changeset: 8:ce2b4f1632af
1646 o changeset: 8:ce2b4f1632af
1632 | parent: 3:9e887f7a939c
1647 | parent: 3:9e887f7a939c
1633 | user: test
1648 | user: test
1634 | date: Fri Feb 13 21:18:00 2009 -0002
1649 | date: Fri Feb 13 21:18:00 2009 -0002
1635 | summary: added b
1650 | summary: added b
1636 |
1651 |
1637 o changeset: 3:9e887f7a939c
1652 o changeset: 3:9e887f7a939c
1638 | parent: 0:f7ad41964313
1653 | parent: 0:f7ad41964313
1639 ~ user: test
1654 ~ user: test
1640 date: Thu Jan 01 00:00:00 1970 +0000
1655 date: Thu Jan 01 00:00:00 1970 +0000
1641 summary: bar to b
1656 summary: bar to b
1642
1657
1643 Test that --log is preserved and reused in `hg graft --continue`
1658 Test that --log is preserved and reused in `hg graft --continue`
1644
1659
1645 $ hg up '.^^'
1660 $ hg up '.^^'
1646 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
1661 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
1647 $ hg graft -r 1 -r 2 --log
1662 $ hg graft -r 1 -r 2 --log
1648 grafting 1:80e6d2c47cfe "added b"
1663 grafting 1:80e6d2c47cfe "added b"
1649 merging b
1664 merging b
1650 warning: conflicts while merging b! (edit, then use 'hg resolve --mark')
1665 warning: conflicts while merging b! (edit, then use 'hg resolve --mark')
1651 abort: unresolved conflicts, can't continue
1666 abort: unresolved conflicts, can't continue
1652 (use 'hg resolve' and 'hg graft --continue')
1667 (use 'hg resolve' and 'hg graft --continue')
1653 [255]
1668 [255]
1654
1669
1655 $ echo foobar > b
1670 $ echo foobar > b
1656 $ hg resolve -m
1671 $ hg resolve -m
1657 (no more unresolved files)
1672 (no more unresolved files)
1658 continue: hg graft --continue
1673 continue: hg graft --continue
1659
1674
1660 $ hg graft --continue
1675 $ hg graft --continue
1661 grafting 1:80e6d2c47cfe "added b"
1676 grafting 1:80e6d2c47cfe "added b"
1662 grafting 2:8be98ac1a569 "added c"
1677 grafting 2:8be98ac1a569 "added c"
1663
1678
1664 $ hg log -GT "{rev}:{node|short} {desc}" -r '.^^::.'
1679 $ hg log -GT "{rev}:{node|short} {desc}" -r '.^^::.'
1665 @ 11:30c1050a58b2 added c
1680 @ 11:30c1050a58b2 added c
1666 | (grafted from 8be98ac1a56990c2d9ca6861041b8390af7bd6f3)
1681 | (grafted from 8be98ac1a56990c2d9ca6861041b8390af7bd6f3)
1667 o 10:ec7eda2313e2 added b
1682 o 10:ec7eda2313e2 added b
1668 | (grafted from 80e6d2c47cfe5b3185519568327a17a061c7efb6)
1683 | (grafted from 80e6d2c47cfe5b3185519568327a17a061c7efb6)
1669 o 3:9e887f7a939c bar to b
1684 o 3:9e887f7a939c bar to b
1670 |
1685 |
1671 ~
1686 ~
1672
1687
1673 $ cd ..
1688 $ cd ..
1674
1689
1675 Testing the --stop flag of `hg graft` which stops the interrupted graft
1690 Testing the --stop flag of `hg graft` which stops the interrupted graft
1676
1691
1677 $ hg init stopgraft
1692 $ hg init stopgraft
1678 $ cd stopgraft
1693 $ cd stopgraft
1679 $ for ch in a b c d; do echo $ch > $ch; hg add $ch; hg ci -Aqm "added "$ch; done;
1694 $ for ch in a b c d; do echo $ch > $ch; hg add $ch; hg ci -Aqm "added "$ch; done;
1680
1695
1681 $ hg log -G
1696 $ hg log -G
1682 @ changeset: 3:9150fe93bec6
1697 @ changeset: 3:9150fe93bec6
1683 | tag: tip
1698 | tag: tip
1684 | user: test
1699 | user: test
1685 | date: Thu Jan 01 00:00:00 1970 +0000
1700 | date: Thu Jan 01 00:00:00 1970 +0000
1686 | summary: added d
1701 | summary: added d
1687 |
1702 |
1688 o changeset: 2:155349b645be
1703 o changeset: 2:155349b645be
1689 | user: test
1704 | user: test
1690 | date: Thu Jan 01 00:00:00 1970 +0000
1705 | date: Thu Jan 01 00:00:00 1970 +0000
1691 | summary: added c
1706 | summary: added c
1692 |
1707 |
1693 o changeset: 1:5f6d8a4bf34a
1708 o changeset: 1:5f6d8a4bf34a
1694 | user: test
1709 | user: test
1695 | date: Thu Jan 01 00:00:00 1970 +0000
1710 | date: Thu Jan 01 00:00:00 1970 +0000
1696 | summary: added b
1711 | summary: added b
1697 |
1712 |
1698 o changeset: 0:9092f1db7931
1713 o changeset: 0:9092f1db7931
1699 user: test
1714 user: test
1700 date: Thu Jan 01 00:00:00 1970 +0000
1715 date: Thu Jan 01 00:00:00 1970 +0000
1701 summary: added a
1716 summary: added a
1702
1717
1703 $ hg up '.^^'
1718 $ hg up '.^^'
1704 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
1719 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
1705
1720
1706 $ echo foo > d
1721 $ echo foo > d
1707 $ hg ci -Aqm "added foo to d"
1722 $ hg ci -Aqm "added foo to d"
1708
1723
1709 $ hg graft --stop
1724 $ hg graft --stop
1710 abort: no interrupted graft found
1725 abort: no interrupted graft found
1711 [255]
1726 [255]
1712
1727
1713 $ hg graft -r 3
1728 $ hg graft -r 3
1714 grafting 3:9150fe93bec6 "added d"
1729 grafting 3:9150fe93bec6 "added d"
1715 merging d
1730 merging d
1716 warning: conflicts while merging d! (edit, then use 'hg resolve --mark')
1731 warning: conflicts while merging d! (edit, then use 'hg resolve --mark')
1717 abort: unresolved conflicts, can't continue
1732 abort: unresolved conflicts, can't continue
1718 (use 'hg resolve' and 'hg graft --continue')
1733 (use 'hg resolve' and 'hg graft --continue')
1719 [255]
1734 [255]
1720
1735
1721 $ hg graft --stop --continue
1736 $ hg graft --stop --continue
1722 abort: cannot use '--continue' and '--stop' together
1737 abort: cannot use '--continue' and '--stop' together
1723 [255]
1738 [255]
1724
1739
1725 $ hg graft --stop -U
1740 $ hg graft --stop -U
1726 abort: cannot specify any other flag with '--stop'
1741 abort: cannot specify any other flag with '--stop'
1727 [255]
1742 [255]
1728 $ hg graft --stop --rev 4
1743 $ hg graft --stop --rev 4
1729 abort: cannot specify any other flag with '--stop'
1744 abort: cannot specify any other flag with '--stop'
1730 [255]
1745 [255]
1731 $ hg graft --stop --log
1746 $ hg graft --stop --log
1732 abort: cannot specify any other flag with '--stop'
1747 abort: cannot specify any other flag with '--stop'
1733 [255]
1748 [255]
1734
1749
1735 $ hg graft --stop
1750 $ hg graft --stop
1736 stopped the interrupted graft
1751 stopped the interrupted graft
1737 working directory is now at a0deacecd59d
1752 working directory is now at a0deacecd59d
1738
1753
1739 $ hg diff
1754 $ hg diff
1740
1755
1741 $ hg log -Gr '.'
1756 $ hg log -Gr '.'
1742 @ changeset: 4:a0deacecd59d
1757 @ changeset: 4:a0deacecd59d
1743 | tag: tip
1758 | tag: tip
1744 ~ parent: 1:5f6d8a4bf34a
1759 ~ parent: 1:5f6d8a4bf34a
1745 user: test
1760 user: test
1746 date: Thu Jan 01 00:00:00 1970 +0000
1761 date: Thu Jan 01 00:00:00 1970 +0000
1747 summary: added foo to d
1762 summary: added foo to d
1748
1763
1749 $ hg graft -r 2 -r 3
1764 $ hg graft -r 2 -r 3
1750 grafting 2:155349b645be "added c"
1765 grafting 2:155349b645be "added c"
1751 grafting 3:9150fe93bec6 "added d"
1766 grafting 3:9150fe93bec6 "added d"
1752 merging d
1767 merging d
1753 warning: conflicts while merging d! (edit, then use 'hg resolve --mark')
1768 warning: conflicts while merging d! (edit, then use 'hg resolve --mark')
1754 abort: unresolved conflicts, can't continue
1769 abort: unresolved conflicts, can't continue
1755 (use 'hg resolve' and 'hg graft --continue')
1770 (use 'hg resolve' and 'hg graft --continue')
1756 [255]
1771 [255]
1757
1772
1758 $ hg graft --stop
1773 $ hg graft --stop
1759 stopped the interrupted graft
1774 stopped the interrupted graft
1760 working directory is now at 75b447541a9e
1775 working directory is now at 75b447541a9e
1761
1776
1762 $ hg diff
1777 $ hg diff
1763
1778
1764 $ hg log -G -T "{rev}:{node|short} {desc}"
1779 $ hg log -G -T "{rev}:{node|short} {desc}"
1765 @ 5:75b447541a9e added c
1780 @ 5:75b447541a9e added c
1766 |
1781 |
1767 o 4:a0deacecd59d added foo to d
1782 o 4:a0deacecd59d added foo to d
1768 |
1783 |
1769 | o 3:9150fe93bec6 added d
1784 | o 3:9150fe93bec6 added d
1770 | |
1785 | |
1771 | o 2:155349b645be added c
1786 | o 2:155349b645be added c
1772 |/
1787 |/
1773 o 1:5f6d8a4bf34a added b
1788 o 1:5f6d8a4bf34a added b
1774 |
1789 |
1775 o 0:9092f1db7931 added a
1790 o 0:9092f1db7931 added a
1776
1791
1777 $ cd ..
1792 $ cd ..
1778
1793
1779 Testing the --abort flag for `hg graft` which aborts and rollback to state
1794 Testing the --abort flag for `hg graft` which aborts and rollback to state
1780 before the graft
1795 before the graft
1781
1796
1782 $ hg init abortgraft
1797 $ hg init abortgraft
1783 $ cd abortgraft
1798 $ cd abortgraft
1784 $ for ch in a b c d; do echo $ch > $ch; hg add $ch; hg ci -Aqm "added "$ch; done;
1799 $ for ch in a b c d; do echo $ch > $ch; hg add $ch; hg ci -Aqm "added "$ch; done;
1785
1800
1786 $ hg up '.^^'
1801 $ hg up '.^^'
1787 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
1802 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
1788
1803
1789 $ echo x > x
1804 $ echo x > x
1790 $ hg ci -Aqm "added x"
1805 $ hg ci -Aqm "added x"
1791 $ hg up '.^'
1806 $ hg up '.^'
1792 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1807 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1793 $ echo foo > c
1808 $ echo foo > c
1794 $ hg ci -Aqm "added foo to c"
1809 $ hg ci -Aqm "added foo to c"
1795
1810
1796 $ hg log -GT "{rev}:{node|short} {desc}"
1811 $ hg log -GT "{rev}:{node|short} {desc}"
1797 @ 5:36b793615f78 added foo to c
1812 @ 5:36b793615f78 added foo to c
1798 |
1813 |
1799 | o 4:863a25e1a9ea added x
1814 | o 4:863a25e1a9ea added x
1800 |/
1815 |/
1801 | o 3:9150fe93bec6 added d
1816 | o 3:9150fe93bec6 added d
1802 | |
1817 | |
1803 | o 2:155349b645be added c
1818 | o 2:155349b645be added c
1804 |/
1819 |/
1805 o 1:5f6d8a4bf34a added b
1820 o 1:5f6d8a4bf34a added b
1806 |
1821 |
1807 o 0:9092f1db7931 added a
1822 o 0:9092f1db7931 added a
1808
1823
1809 $ hg up 9150fe93bec6
1824 $ hg up 9150fe93bec6
1810 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1825 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1811
1826
1812 $ hg graft --abort
1827 $ hg graft --abort
1813 abort: no interrupted graft to abort
1828 abort: no interrupted graft to abort
1814 [255]
1829 [255]
1815
1830
1816 when stripping is required
1831 when stripping is required
1817 $ hg graft -r 4 -r 5
1832 $ hg graft -r 4 -r 5
1818 grafting 4:863a25e1a9ea "added x"
1833 grafting 4:863a25e1a9ea "added x"
1819 grafting 5:36b793615f78 "added foo to c" (tip)
1834 grafting 5:36b793615f78 "added foo to c" (tip)
1820 merging c
1835 merging c
1821 warning: conflicts while merging c! (edit, then use 'hg resolve --mark')
1836 warning: conflicts while merging c! (edit, then use 'hg resolve --mark')
1822 abort: unresolved conflicts, can't continue
1837 abort: unresolved conflicts, can't continue
1823 (use 'hg resolve' and 'hg graft --continue')
1838 (use 'hg resolve' and 'hg graft --continue')
1824 [255]
1839 [255]
1825
1840
1826 $ hg graft --continue --abort
1841 $ hg graft --continue --abort
1827 abort: cannot use '--continue' and '--abort' together
1842 abort: cannot use '--continue' and '--abort' together
1828 [255]
1843 [255]
1829
1844
1830 $ hg graft --abort --stop
1845 $ hg graft --abort --stop
1831 abort: cannot use '--abort' and '--stop' together
1846 abort: cannot use '--abort' and '--stop' together
1832 [255]
1847 [255]
1833
1848
1834 $ hg graft --abort --currentuser
1849 $ hg graft --abort --currentuser
1835 abort: cannot specify any other flag with '--abort'
1850 abort: cannot specify any other flag with '--abort'
1836 [255]
1851 [255]
1837
1852
1838 $ hg graft --abort --edit
1853 $ hg graft --abort --edit
1839 abort: cannot specify any other flag with '--abort'
1854 abort: cannot specify any other flag with '--abort'
1840 [255]
1855 [255]
1841
1856
1842 $ hg graft --abort
1857 $ hg graft --abort
1843 graft aborted
1858 graft aborted
1844 working directory is now at 9150fe93bec6
1859 working directory is now at 9150fe93bec6
1845 $ hg log -GT "{rev}:{node|short} {desc}"
1860 $ hg log -GT "{rev}:{node|short} {desc}"
1846 o 5:36b793615f78 added foo to c
1861 o 5:36b793615f78 added foo to c
1847 |
1862 |
1848 | o 4:863a25e1a9ea added x
1863 | o 4:863a25e1a9ea added x
1849 |/
1864 |/
1850 | @ 3:9150fe93bec6 added d
1865 | @ 3:9150fe93bec6 added d
1851 | |
1866 | |
1852 | o 2:155349b645be added c
1867 | o 2:155349b645be added c
1853 |/
1868 |/
1854 o 1:5f6d8a4bf34a added b
1869 o 1:5f6d8a4bf34a added b
1855 |
1870 |
1856 o 0:9092f1db7931 added a
1871 o 0:9092f1db7931 added a
1857
1872
1858 when stripping is not required
1873 when stripping is not required
1859 $ hg graft -r 5
1874 $ hg graft -r 5
1860 grafting 5:36b793615f78 "added foo to c" (tip)
1875 grafting 5:36b793615f78 "added foo to c" (tip)
1861 merging c
1876 merging c
1862 warning: conflicts while merging c! (edit, then use 'hg resolve --mark')
1877 warning: conflicts while merging c! (edit, then use 'hg resolve --mark')
1863 abort: unresolved conflicts, can't continue
1878 abort: unresolved conflicts, can't continue
1864 (use 'hg resolve' and 'hg graft --continue')
1879 (use 'hg resolve' and 'hg graft --continue')
1865 [255]
1880 [255]
1866
1881
1867 $ hg graft --abort
1882 $ hg graft --abort
1868 graft aborted
1883 graft aborted
1869 working directory is now at 9150fe93bec6
1884 working directory is now at 9150fe93bec6
1870 $ hg log -GT "{rev}:{node|short} {desc}"
1885 $ hg log -GT "{rev}:{node|short} {desc}"
1871 o 5:36b793615f78 added foo to c
1886 o 5:36b793615f78 added foo to c
1872 |
1887 |
1873 | o 4:863a25e1a9ea added x
1888 | o 4:863a25e1a9ea added x
1874 |/
1889 |/
1875 | @ 3:9150fe93bec6 added d
1890 | @ 3:9150fe93bec6 added d
1876 | |
1891 | |
1877 | o 2:155349b645be added c
1892 | o 2:155349b645be added c
1878 |/
1893 |/
1879 o 1:5f6d8a4bf34a added b
1894 o 1:5f6d8a4bf34a added b
1880 |
1895 |
1881 o 0:9092f1db7931 added a
1896 o 0:9092f1db7931 added a
1882
1897
1883 when some of the changesets became public
1898 when some of the changesets became public
1884
1899
1885 $ hg graft -r 4 -r 5
1900 $ hg graft -r 4 -r 5
1886 grafting 4:863a25e1a9ea "added x"
1901 grafting 4:863a25e1a9ea "added x"
1887 grafting 5:36b793615f78 "added foo to c" (tip)
1902 grafting 5:36b793615f78 "added foo to c" (tip)
1888 merging c
1903 merging c
1889 warning: conflicts while merging c! (edit, then use 'hg resolve --mark')
1904 warning: conflicts while merging c! (edit, then use 'hg resolve --mark')
1890 abort: unresolved conflicts, can't continue
1905 abort: unresolved conflicts, can't continue
1891 (use 'hg resolve' and 'hg graft --continue')
1906 (use 'hg resolve' and 'hg graft --continue')
1892 [255]
1907 [255]
1893
1908
1894 $ hg log -GT "{rev}:{node|short} {desc}"
1909 $ hg log -GT "{rev}:{node|short} {desc}"
1895 @ 6:6ec71c037d94 added x
1910 @ 6:6ec71c037d94 added x
1896 |
1911 |
1897 | o 5:36b793615f78 added foo to c
1912 | o 5:36b793615f78 added foo to c
1898 | |
1913 | |
1899 | | o 4:863a25e1a9ea added x
1914 | | o 4:863a25e1a9ea added x
1900 | |/
1915 | |/
1901 o | 3:9150fe93bec6 added d
1916 o | 3:9150fe93bec6 added d
1902 | |
1917 | |
1903 o | 2:155349b645be added c
1918 o | 2:155349b645be added c
1904 |/
1919 |/
1905 o 1:5f6d8a4bf34a added b
1920 o 1:5f6d8a4bf34a added b
1906 |
1921 |
1907 o 0:9092f1db7931 added a
1922 o 0:9092f1db7931 added a
1908
1923
1909 $ hg phase -r 6 --public
1924 $ hg phase -r 6 --public
1910
1925
1911 $ hg graft --abort
1926 $ hg graft --abort
1912 cannot clean up public changesets 6ec71c037d94
1927 cannot clean up public changesets 6ec71c037d94
1913 graft aborted
1928 graft aborted
1914 working directory is now at 6ec71c037d94
1929 working directory is now at 6ec71c037d94
1915
1930
1916 when we created new changesets on top of existing one
1931 when we created new changesets on top of existing one
1917
1932
1918 $ hg up '.^^'
1933 $ hg up '.^^'
1919 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
1934 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
1920 $ echo y > y
1935 $ echo y > y
1921 $ hg ci -Aqm "added y"
1936 $ hg ci -Aqm "added y"
1922 $ echo z > z
1937 $ echo z > z
1923 $ hg ci -Aqm "added z"
1938 $ hg ci -Aqm "added z"
1924
1939
1925 $ hg up 3
1940 $ hg up 3
1926 1 files updated, 0 files merged, 3 files removed, 0 files unresolved
1941 1 files updated, 0 files merged, 3 files removed, 0 files unresolved
1927 $ hg log -GT "{rev}:{node|short} {desc}"
1942 $ hg log -GT "{rev}:{node|short} {desc}"
1928 o 8:637f9e9bbfd4 added z
1943 o 8:637f9e9bbfd4 added z
1929 |
1944 |
1930 o 7:123221671fd4 added y
1945 o 7:123221671fd4 added y
1931 |
1946 |
1932 | o 6:6ec71c037d94 added x
1947 | o 6:6ec71c037d94 added x
1933 | |
1948 | |
1934 | | o 5:36b793615f78 added foo to c
1949 | | o 5:36b793615f78 added foo to c
1935 | | |
1950 | | |
1936 | | | o 4:863a25e1a9ea added x
1951 | | | o 4:863a25e1a9ea added x
1937 | | |/
1952 | | |/
1938 | @ | 3:9150fe93bec6 added d
1953 | @ | 3:9150fe93bec6 added d
1939 |/ /
1954 |/ /
1940 o / 2:155349b645be added c
1955 o / 2:155349b645be added c
1941 |/
1956 |/
1942 o 1:5f6d8a4bf34a added b
1957 o 1:5f6d8a4bf34a added b
1943 |
1958 |
1944 o 0:9092f1db7931 added a
1959 o 0:9092f1db7931 added a
1945
1960
1946 $ hg graft -r 8 -r 7 -r 5
1961 $ hg graft -r 8 -r 7 -r 5
1947 grafting 8:637f9e9bbfd4 "added z" (tip)
1962 grafting 8:637f9e9bbfd4 "added z" (tip)
1948 grafting 7:123221671fd4 "added y"
1963 grafting 7:123221671fd4 "added y"
1949 grafting 5:36b793615f78 "added foo to c"
1964 grafting 5:36b793615f78 "added foo to c"
1950 merging c
1965 merging c
1951 warning: conflicts while merging c! (edit, then use 'hg resolve --mark')
1966 warning: conflicts while merging c! (edit, then use 'hg resolve --mark')
1952 abort: unresolved conflicts, can't continue
1967 abort: unresolved conflicts, can't continue
1953 (use 'hg resolve' and 'hg graft --continue')
1968 (use 'hg resolve' and 'hg graft --continue')
1954 [255]
1969 [255]
1955
1970
1956 $ cd ..
1971 $ cd ..
1957 $ hg init pullrepo
1972 $ hg init pullrepo
1958 $ cd pullrepo
1973 $ cd pullrepo
1959 $ cat >> .hg/hgrc <<EOF
1974 $ cat >> .hg/hgrc <<EOF
1960 > [phases]
1975 > [phases]
1961 > publish=False
1976 > publish=False
1962 > EOF
1977 > EOF
1963 $ hg pull ../abortgraft --config phases.publish=False
1978 $ hg pull ../abortgraft --config phases.publish=False
1964 pulling from ../abortgraft
1979 pulling from ../abortgraft
1965 requesting all changes
1980 requesting all changes
1966 adding changesets
1981 adding changesets
1967 adding manifests
1982 adding manifests
1968 adding file changes
1983 adding file changes
1969 added 11 changesets with 9 changes to 8 files (+4 heads)
1984 added 11 changesets with 9 changes to 8 files (+4 heads)
1970 new changesets 9092f1db7931:6b98ff0062dd (6 drafts)
1985 new changesets 9092f1db7931:6b98ff0062dd (6 drafts)
1971 (run 'hg heads' to see heads, 'hg merge' to merge)
1986 (run 'hg heads' to see heads, 'hg merge' to merge)
1972 $ hg up 9
1987 $ hg up 9
1973 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1988 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1974 $ echo w > w
1989 $ echo w > w
1975 $ hg ci -Aqm "added w" --config phases.publish=False
1990 $ hg ci -Aqm "added w" --config phases.publish=False
1976
1991
1977 $ cd ../abortgraft
1992 $ cd ../abortgraft
1978 $ hg pull ../pullrepo
1993 $ hg pull ../pullrepo
1979 pulling from ../pullrepo
1994 pulling from ../pullrepo
1980 searching for changes
1995 searching for changes
1981 adding changesets
1996 adding changesets
1982 adding manifests
1997 adding manifests
1983 adding file changes
1998 adding file changes
1984 added 1 changesets with 1 changes to 1 files (+1 heads)
1999 added 1 changesets with 1 changes to 1 files (+1 heads)
1985 new changesets 311dfc6cf3bf (1 drafts)
2000 new changesets 311dfc6cf3bf (1 drafts)
1986 (run 'hg heads .' to see heads, 'hg merge' to merge)
2001 (run 'hg heads .' to see heads, 'hg merge' to merge)
1987
2002
1988 $ hg graft --abort
2003 $ hg graft --abort
1989 new changesets detected on destination branch, can't strip
2004 new changesets detected on destination branch, can't strip
1990 graft aborted
2005 graft aborted
1991 working directory is now at 6b98ff0062dd
2006 working directory is now at 6b98ff0062dd
1992
2007
1993 $ cd ..
2008 $ cd ..
1994
2009
1995 ============================
2010 ============================
1996 Testing --no-commit option:|
2011 Testing --no-commit option:|
1997 ============================
2012 ============================
1998
2013
1999 $ hg init nocommit
2014 $ hg init nocommit
2000 $ cd nocommit
2015 $ cd nocommit
2001 $ echo a > a
2016 $ echo a > a
2002 $ hg ci -qAma
2017 $ hg ci -qAma
2003 $ echo b > b
2018 $ echo b > b
2004 $ hg ci -qAmb
2019 $ hg ci -qAmb
2005 $ hg up -q 0
2020 $ hg up -q 0
2006 $ echo c > c
2021 $ echo c > c
2007 $ hg ci -qAmc
2022 $ hg ci -qAmc
2008 $ hg log -GT "{rev}:{node|short} {desc}\n"
2023 $ hg log -GT "{rev}:{node|short} {desc}\n"
2009 @ 2:d36c0562f908 c
2024 @ 2:d36c0562f908 c
2010 |
2025 |
2011 | o 1:d2ae7f538514 b
2026 | o 1:d2ae7f538514 b
2012 |/
2027 |/
2013 o 0:cb9a9f314b8b a
2028 o 0:cb9a9f314b8b a
2014
2029
2015
2030
2016 Check reporting when --no-commit used with non-applicable options:
2031 Check reporting when --no-commit used with non-applicable options:
2017
2032
2018 $ hg graft 1 --no-commit -e
2033 $ hg graft 1 --no-commit -e
2019 abort: cannot specify --no-commit and --edit together
2034 abort: cannot specify --no-commit and --edit together
2020 [255]
2035 [255]
2021
2036
2022 $ hg graft 1 --no-commit --log
2037 $ hg graft 1 --no-commit --log
2023 abort: cannot specify --no-commit and --log together
2038 abort: cannot specify --no-commit and --log together
2024 [255]
2039 [255]
2025
2040
2026 $ hg graft 1 --no-commit -D
2041 $ hg graft 1 --no-commit -D
2027 abort: cannot specify --no-commit and --currentdate together
2042 abort: cannot specify --no-commit and --currentdate together
2028 [255]
2043 [255]
2029
2044
2030 Test --no-commit is working:
2045 Test --no-commit is working:
2031 $ hg graft 1 --no-commit
2046 $ hg graft 1 --no-commit
2032 grafting 1:d2ae7f538514 "b"
2047 grafting 1:d2ae7f538514 "b"
2033
2048
2034 $ hg log -GT "{rev}:{node|short} {desc}\n"
2049 $ hg log -GT "{rev}:{node|short} {desc}\n"
2035 @ 2:d36c0562f908 c
2050 @ 2:d36c0562f908 c
2036 |
2051 |
2037 | o 1:d2ae7f538514 b
2052 | o 1:d2ae7f538514 b
2038 |/
2053 |/
2039 o 0:cb9a9f314b8b a
2054 o 0:cb9a9f314b8b a
2040
2055
2041
2056
2042 $ hg diff
2057 $ hg diff
2043 diff -r d36c0562f908 b
2058 diff -r d36c0562f908 b
2044 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2059 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2045 +++ b/b Thu Jan 01 00:00:00 1970 +0000
2060 +++ b/b Thu Jan 01 00:00:00 1970 +0000
2046 @@ -0,0 +1,1 @@
2061 @@ -0,0 +1,1 @@
2047 +b
2062 +b
2048
2063
2049 Prepare wrdir to check --no-commit is resepected after --continue:
2064 Prepare wrdir to check --no-commit is resepected after --continue:
2050
2065
2051 $ hg up -qC
2066 $ hg up -qC
2052 $ echo A>a
2067 $ echo A>a
2053 $ hg ci -qm "A in file a"
2068 $ hg ci -qm "A in file a"
2054 $ hg up -q 1
2069 $ hg up -q 1
2055 $ echo B>a
2070 $ echo B>a
2056 $ hg ci -qm "B in file a"
2071 $ hg ci -qm "B in file a"
2057 $ hg log -GT "{rev}:{node|short} {desc}\n"
2072 $ hg log -GT "{rev}:{node|short} {desc}\n"
2058 @ 4:2aa9ad1006ff B in file a
2073 @ 4:2aa9ad1006ff B in file a
2059 |
2074 |
2060 | o 3:09e253b87e17 A in file a
2075 | o 3:09e253b87e17 A in file a
2061 | |
2076 | |
2062 | o 2:d36c0562f908 c
2077 | o 2:d36c0562f908 c
2063 | |
2078 | |
2064 o | 1:d2ae7f538514 b
2079 o | 1:d2ae7f538514 b
2065 |/
2080 |/
2066 o 0:cb9a9f314b8b a
2081 o 0:cb9a9f314b8b a
2067
2082
2068
2083
2069 $ hg graft 3 --no-commit
2084 $ hg graft 3 --no-commit
2070 grafting 3:09e253b87e17 "A in file a"
2085 grafting 3:09e253b87e17 "A in file a"
2071 merging a
2086 merging a
2072 warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
2087 warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
2073 abort: unresolved conflicts, can't continue
2088 abort: unresolved conflicts, can't continue
2074 (use 'hg resolve' and 'hg graft --continue')
2089 (use 'hg resolve' and 'hg graft --continue')
2075 [255]
2090 [255]
2076
2091
2077 Resolve conflict:
2092 Resolve conflict:
2078 $ echo A>a
2093 $ echo A>a
2079 $ hg resolve --mark
2094 $ hg resolve --mark
2080 (no more unresolved files)
2095 (no more unresolved files)
2081 continue: hg graft --continue
2096 continue: hg graft --continue
2082
2097
2083 $ hg graft --continue
2098 $ hg graft --continue
2084 grafting 3:09e253b87e17 "A in file a"
2099 grafting 3:09e253b87e17 "A in file a"
2085 $ hg log -GT "{rev}:{node|short} {desc}\n"
2100 $ hg log -GT "{rev}:{node|short} {desc}\n"
2086 @ 4:2aa9ad1006ff B in file a
2101 @ 4:2aa9ad1006ff B in file a
2087 |
2102 |
2088 | o 3:09e253b87e17 A in file a
2103 | o 3:09e253b87e17 A in file a
2089 | |
2104 | |
2090 | o 2:d36c0562f908 c
2105 | o 2:d36c0562f908 c
2091 | |
2106 | |
2092 o | 1:d2ae7f538514 b
2107 o | 1:d2ae7f538514 b
2093 |/
2108 |/
2094 o 0:cb9a9f314b8b a
2109 o 0:cb9a9f314b8b a
2095
2110
2096 $ hg diff
2111 $ hg diff
2097 diff -r 2aa9ad1006ff a
2112 diff -r 2aa9ad1006ff a
2098 --- a/a Thu Jan 01 00:00:00 1970 +0000
2113 --- a/a Thu Jan 01 00:00:00 1970 +0000
2099 +++ b/a Thu Jan 01 00:00:00 1970 +0000
2114 +++ b/a Thu Jan 01 00:00:00 1970 +0000
2100 @@ -1,1 +1,1 @@
2115 @@ -1,1 +1,1 @@
2101 -B
2116 -B
2102 +A
2117 +A
2103
2118
2104 $ hg up -qC
2119 $ hg up -qC
2105
2120
2106 Check --no-commit is resepected when passed with --continue:
2121 Check --no-commit is resepected when passed with --continue:
2107
2122
2108 $ hg graft 3
2123 $ hg graft 3
2109 grafting 3:09e253b87e17 "A in file a"
2124 grafting 3:09e253b87e17 "A in file a"
2110 merging a
2125 merging a
2111 warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
2126 warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
2112 abort: unresolved conflicts, can't continue
2127 abort: unresolved conflicts, can't continue
2113 (use 'hg resolve' and 'hg graft --continue')
2128 (use 'hg resolve' and 'hg graft --continue')
2114 [255]
2129 [255]
2115
2130
2116 Resolve conflict:
2131 Resolve conflict:
2117 $ echo A>a
2132 $ echo A>a
2118 $ hg resolve --mark
2133 $ hg resolve --mark
2119 (no more unresolved files)
2134 (no more unresolved files)
2120 continue: hg graft --continue
2135 continue: hg graft --continue
2121
2136
2122 $ hg graft --continue --no-commit
2137 $ hg graft --continue --no-commit
2123 grafting 3:09e253b87e17 "A in file a"
2138 grafting 3:09e253b87e17 "A in file a"
2124 $ hg diff
2139 $ hg diff
2125 diff -r 2aa9ad1006ff a
2140 diff -r 2aa9ad1006ff a
2126 --- a/a Thu Jan 01 00:00:00 1970 +0000
2141 --- a/a Thu Jan 01 00:00:00 1970 +0000
2127 +++ b/a Thu Jan 01 00:00:00 1970 +0000
2142 +++ b/a Thu Jan 01 00:00:00 1970 +0000
2128 @@ -1,1 +1,1 @@
2143 @@ -1,1 +1,1 @@
2129 -B
2144 -B
2130 +A
2145 +A
2131
2146
2132 $ hg log -GT "{rev}:{node|short} {desc}\n"
2147 $ hg log -GT "{rev}:{node|short} {desc}\n"
2133 @ 4:2aa9ad1006ff B in file a
2148 @ 4:2aa9ad1006ff B in file a
2134 |
2149 |
2135 | o 3:09e253b87e17 A in file a
2150 | o 3:09e253b87e17 A in file a
2136 | |
2151 | |
2137 | o 2:d36c0562f908 c
2152 | o 2:d36c0562f908 c
2138 | |
2153 | |
2139 o | 1:d2ae7f538514 b
2154 o | 1:d2ae7f538514 b
2140 |/
2155 |/
2141 o 0:cb9a9f314b8b a
2156 o 0:cb9a9f314b8b a
2142
2157
2143 $ hg up -qC
2158 $ hg up -qC
2144
2159
2145 Test --no-commit when graft multiple revisions:
2160 Test --no-commit when graft multiple revisions:
2146 When there is conflict:
2161 When there is conflict:
2147 $ hg graft -r "2::3" --no-commit
2162 $ hg graft -r "2::3" --no-commit
2148 grafting 2:d36c0562f908 "c"
2163 grafting 2:d36c0562f908 "c"
2149 grafting 3:09e253b87e17 "A in file a"
2164 grafting 3:09e253b87e17 "A in file a"
2150 merging a
2165 merging a
2151 warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
2166 warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
2152 abort: unresolved conflicts, can't continue
2167 abort: unresolved conflicts, can't continue
2153 (use 'hg resolve' and 'hg graft --continue')
2168 (use 'hg resolve' and 'hg graft --continue')
2154 [255]
2169 [255]
2155
2170
2156 $ echo A>a
2171 $ echo A>a
2157 $ hg resolve --mark
2172 $ hg resolve --mark
2158 (no more unresolved files)
2173 (no more unresolved files)
2159 continue: hg graft --continue
2174 continue: hg graft --continue
2160 $ hg graft --continue
2175 $ hg graft --continue
2161 grafting 3:09e253b87e17 "A in file a"
2176 grafting 3:09e253b87e17 "A in file a"
2162 $ hg diff
2177 $ hg diff
2163 diff -r 2aa9ad1006ff a
2178 diff -r 2aa9ad1006ff a
2164 --- a/a Thu Jan 01 00:00:00 1970 +0000
2179 --- a/a Thu Jan 01 00:00:00 1970 +0000
2165 +++ b/a Thu Jan 01 00:00:00 1970 +0000
2180 +++ b/a Thu Jan 01 00:00:00 1970 +0000
2166 @@ -1,1 +1,1 @@
2181 @@ -1,1 +1,1 @@
2167 -B
2182 -B
2168 +A
2183 +A
2169 diff -r 2aa9ad1006ff c
2184 diff -r 2aa9ad1006ff c
2170 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2185 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2171 +++ b/c Thu Jan 01 00:00:00 1970 +0000
2186 +++ b/c Thu Jan 01 00:00:00 1970 +0000
2172 @@ -0,0 +1,1 @@
2187 @@ -0,0 +1,1 @@
2173 +c
2188 +c
2174
2189
2175 $ hg log -GT "{rev}:{node|short} {desc}\n"
2190 $ hg log -GT "{rev}:{node|short} {desc}\n"
2176 @ 4:2aa9ad1006ff B in file a
2191 @ 4:2aa9ad1006ff B in file a
2177 |
2192 |
2178 | o 3:09e253b87e17 A in file a
2193 | o 3:09e253b87e17 A in file a
2179 | |
2194 | |
2180 | o 2:d36c0562f908 c
2195 | o 2:d36c0562f908 c
2181 | |
2196 | |
2182 o | 1:d2ae7f538514 b
2197 o | 1:d2ae7f538514 b
2183 |/
2198 |/
2184 o 0:cb9a9f314b8b a
2199 o 0:cb9a9f314b8b a
2185
2200
2186 $ hg up -qC
2201 $ hg up -qC
2187
2202
2188 When there is no conflict:
2203 When there is no conflict:
2189 $ echo d>d
2204 $ echo d>d
2190 $ hg add d -q
2205 $ hg add d -q
2191 $ hg ci -qmd
2206 $ hg ci -qmd
2192 $ hg up 3 -q
2207 $ hg up 3 -q
2193 $ hg log -GT "{rev}:{node|short} {desc}\n"
2208 $ hg log -GT "{rev}:{node|short} {desc}\n"
2194 o 5:baefa8927fc0 d
2209 o 5:baefa8927fc0 d
2195 |
2210 |
2196 o 4:2aa9ad1006ff B in file a
2211 o 4:2aa9ad1006ff B in file a
2197 |
2212 |
2198 | @ 3:09e253b87e17 A in file a
2213 | @ 3:09e253b87e17 A in file a
2199 | |
2214 | |
2200 | o 2:d36c0562f908 c
2215 | o 2:d36c0562f908 c
2201 | |
2216 | |
2202 o | 1:d2ae7f538514 b
2217 o | 1:d2ae7f538514 b
2203 |/
2218 |/
2204 o 0:cb9a9f314b8b a
2219 o 0:cb9a9f314b8b a
2205
2220
2206
2221
2207 $ hg graft -r 1 -r 5 --no-commit
2222 $ hg graft -r 1 -r 5 --no-commit
2208 grafting 1:d2ae7f538514 "b"
2223 grafting 1:d2ae7f538514 "b"
2209 grafting 5:baefa8927fc0 "d" (tip)
2224 grafting 5:baefa8927fc0 "d" (tip)
2210 $ hg diff
2225 $ hg diff
2211 diff -r 09e253b87e17 b
2226 diff -r 09e253b87e17 b
2212 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2227 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2213 +++ b/b Thu Jan 01 00:00:00 1970 +0000
2228 +++ b/b Thu Jan 01 00:00:00 1970 +0000
2214 @@ -0,0 +1,1 @@
2229 @@ -0,0 +1,1 @@
2215 +b
2230 +b
2216 diff -r 09e253b87e17 d
2231 diff -r 09e253b87e17 d
2217 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2232 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2218 +++ b/d Thu Jan 01 00:00:00 1970 +0000
2233 +++ b/d Thu Jan 01 00:00:00 1970 +0000
2219 @@ -0,0 +1,1 @@
2234 @@ -0,0 +1,1 @@
2220 +d
2235 +d
2221 $ hg log -GT "{rev}:{node|short} {desc}\n"
2236 $ hg log -GT "{rev}:{node|short} {desc}\n"
2222 o 5:baefa8927fc0 d
2237 o 5:baefa8927fc0 d
2223 |
2238 |
2224 o 4:2aa9ad1006ff B in file a
2239 o 4:2aa9ad1006ff B in file a
2225 |
2240 |
2226 | @ 3:09e253b87e17 A in file a
2241 | @ 3:09e253b87e17 A in file a
2227 | |
2242 | |
2228 | o 2:d36c0562f908 c
2243 | o 2:d36c0562f908 c
2229 | |
2244 | |
2230 o | 1:d2ae7f538514 b
2245 o | 1:d2ae7f538514 b
2231 |/
2246 |/
2232 o 0:cb9a9f314b8b a
2247 o 0:cb9a9f314b8b a
2233
2248
2234 $ cd ..
2249 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now