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