author | Mads Kiilerich <mads@kiilerich.com> |
Fri, 13 Jan 2012 01:19:08 +0100 | |
changeset 15884 | cc8287d51680 |
parent 15777 | 12309c09d19a |
child 15907 | 51fc43253a52 |
permissions | -rw-r--r-- |
15361 | 1 |
Create a repo with some stuff in it: |
2 |
||
3 |
$ hg init a |
|
4 |
$ cd a |
|
5 |
$ echo a > a |
|
6 |
$ echo a > d |
|
7 |
$ echo a > e |
|
8 |
$ hg ci -qAm0 |
|
9 |
$ echo b > a |
|
10 |
$ hg ci -m1 -u bar |
|
11 |
$ hg mv a b |
|
12 |
$ hg ci -m2 |
|
13 |
$ hg cp b c |
|
14 |
$ hg ci -m3 -u baz |
|
15 |
$ echo b > d |
|
16 |
$ echo f > e |
|
17 |
$ hg ci -m4 |
|
18 |
$ hg up -q 3 |
|
19 |
$ echo b > e |
|
20 |
$ hg branch -q stable |
|
21 |
$ hg ci -m5 |
|
22 |
$ hg merge -q default --tool internal:local |
|
23 |
$ hg branch -q default |
|
24 |
$ hg ci -m6 |
|
25 |
||
26 |
Need to specify a rev: |
|
27 |
||
28 |
$ hg graft |
|
29 |
abort: no revisions specified |
|
30 |
[255] |
|
31 |
||
32 |
Can't graft ancestor: |
|
33 |
||
34 |
$ hg graft 1 2 |
|
35 |
skipping ancestor revision 1 |
|
36 |
skipping ancestor revision 2 |
|
37 |
[255] |
|
38 |
||
39 |
Can't graft with dirty wd: |
|
40 |
||
41 |
$ hg up -q 0 |
|
42 |
$ echo foo > a |
|
43 |
$ hg graft 1 |
|
44 |
abort: outstanding uncommitted changes |
|
45 |
[255] |
|
46 |
$ hg revert a |
|
47 |
||
48 |
Graft a rename: |
|
49 |
||
50 |
$ hg graft 2 -u foo |
|
51 |
grafting revision 2 |
|
52 |
merging a and b to b |
|
53 |
$ hg export tip --git |
|
54 |
# HG changeset patch |
|
55 |
# User foo |
|
56 |
# Date 0 0 |
|
57 |
# Node ID d2e44c99fd3f31c176ea4efb9eca9f6306c81756 |
|
58 |
# Parent 68795b066622ca79a25816a662041d8f78f3cd9e |
|
59 |
2 |
|
60 |
||
61 |
diff --git a/a b/b |
|
62 |
rename from a |
|
63 |
rename to b |
|
64 |
--- a/a |
|
65 |
+++ b/b |
|
66 |
@@ -1,1 +1,1 @@ |
|
67 |
-a |
|
68 |
+b |
|
69 |
||
70 |
Look for extra:source |
|
71 |
||
72 |
$ hg log --debug -r tip |
|
73 |
changeset: 7:d2e44c99fd3f31c176ea4efb9eca9f6306c81756 |
|
74 |
tag: tip |
|
75 |
parent: 0:68795b066622ca79a25816a662041d8f78f3cd9e |
|
76 |
parent: -1:0000000000000000000000000000000000000000 |
|
77 |
manifest: 7:5d59766436fd8fbcd38e7bebef0f6eaf3eebe637 |
|
78 |
user: foo |
|
79 |
date: Thu Jan 01 00:00:00 1970 +0000 |
|
80 |
files+: b |
|
81 |
files-: a |
|
82 |
extra: branch=default |
|
83 |
extra: source=5c095ad7e90f871700f02dd1fa5012cb4498a2d4 |
|
84 |
description: |
|
85 |
2 |
|
86 |
||
87 |
||
88 |
||
89 |
Graft out of order, skipping a merge and a duplicate |
|
90 |
||
91 |
$ hg graft 1 5 4 3 'merge()' 2 --debug |
|
92 |
skipping ungraftable merge revision 6 |
|
93 |
scanning for duplicate grafts |
|
94 |
skipping already grafted revision 2 |
|
95 |
grafting revision 1 |
|
96 |
searching for copies back to rev 1 |
|
97 |
unmatched files in local: |
|
98 |
a.orig |
|
99 |
b |
|
100 |
all copies found (* = to merge, ! = divergent): |
|
101 |
b -> a * |
|
102 |
checking for directory renames |
|
103 |
resolving manifests |
|
15625
efdcce3fd2d5
merge: make debug output easier to read
Martin Geisler <mg@aragost.com>
parents:
15513
diff
changeset
|
104 |
overwrite: False, partial: False |
efdcce3fd2d5
merge: make debug output easier to read
Martin Geisler <mg@aragost.com>
parents:
15513
diff
changeset
|
105 |
ancestor: 68795b066622, local: d2e44c99fd3f+, remote: 5d205f8b35b6 |
15361 | 106 |
b: local copied/moved to a -> m |
107 |
preserving b for resolve of b |
|
108 |
updating: b 1/1 files (100.00%) |
|
109 |
b |
|
110 |
b: searching for copy revision for a |
|
111 |
b: copy a:b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 |
|
112 |
grafting revision 5 |
|
113 |
searching for copies back to rev 1 |
|
114 |
unmatched files in local: |
|
115 |
a.orig |
|
116 |
resolving manifests |
|
15625
efdcce3fd2d5
merge: make debug output easier to read
Martin Geisler <mg@aragost.com>
parents:
15513
diff
changeset
|
117 |
overwrite: False, partial: False |
efdcce3fd2d5
merge: make debug output easier to read
Martin Geisler <mg@aragost.com>
parents:
15513
diff
changeset
|
118 |
ancestor: 4c60f11aa304, local: 6f5ea6ac8b70+, remote: 97f8bfe72746 |
15361 | 119 |
e: remote is newer -> g |
120 |
updating: e 1/1 files (100.00%) |
|
121 |
getting e |
|
122 |
e |
|
123 |
grafting revision 4 |
|
124 |
searching for copies back to rev 1 |
|
125 |
unmatched files in local: |
|
126 |
a.orig |
|
127 |
resolving manifests |
|
15625
efdcce3fd2d5
merge: make debug output easier to read
Martin Geisler <mg@aragost.com>
parents:
15513
diff
changeset
|
128 |
overwrite: False, partial: False |
efdcce3fd2d5
merge: make debug output easier to read
Martin Geisler <mg@aragost.com>
parents:
15513
diff
changeset
|
129 |
ancestor: 4c60f11aa304, local: 77eb504366ab+, remote: 9c233e8e184d |
15361 | 130 |
e: versions differ -> m |
131 |
d: remote is newer -> g |
|
132 |
preserving e for resolve of e |
|
133 |
updating: d 1/2 files (50.00%) |
|
134 |
getting d |
|
135 |
updating: e 2/2 files (100.00%) |
|
136 |
picked tool 'internal:merge' for e (binary False symlink False) |
|
137 |
merging e |
|
138 |
my e@77eb504366ab+ other e@9c233e8e184d ancestor e@68795b066622 |
|
139 |
warning: conflicts during merge. |
|
15501
2371f4aea665
merge: give a special message for internal:merge failure (issue3105)
Matt Mackall <mpm@selenic.com>
parents:
15361
diff
changeset
|
140 |
merging e incomplete! (edit conflicts, then use 'hg resolve --mark') |
15361 | 141 |
abort: unresolved conflicts, can't continue |
142 |
(use hg resolve and hg graft --continue) |
|
143 |
[255] |
|
144 |
||
145 |
Continue without resolve should fail: |
|
146 |
||
147 |
$ hg graft -c |
|
148 |
grafting revision 4 |
|
149 |
abort: unresolved merge conflicts (see hg help resolve) |
|
150 |
[255] |
|
151 |
||
152 |
Fix up: |
|
153 |
||
154 |
$ echo b > e |
|
155 |
$ hg resolve -m e |
|
156 |
||
157 |
Continue with a revision should fail: |
|
158 |
||
159 |
$ hg graft -c 6 |
|
160 |
abort: can't specify --continue and revisions |
|
161 |
[255] |
|
162 |
||
163 |
Continue for real, clobber usernames |
|
164 |
||
165 |
$ hg graft -c -U |
|
166 |
grafting revision 4 |
|
167 |
grafting revision 3 |
|
168 |
||
169 |
Compare with original: |
|
170 |
||
171 |
$ hg diff -r 6 |
|
172 |
$ hg status --rev 0:. -C |
|
173 |
M d |
|
174 |
M e |
|
175 |
A b |
|
176 |
a |
|
177 |
A c |
|
178 |
a |
|
179 |
R a |
|
180 |
||
181 |
View graph: |
|
182 |
||
15507
7186b54b07c6
graft: use revs to make tests more readable
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
15506
diff
changeset
|
183 |
$ hg --config extensions.graphlog= log -G --template '{author}@{rev}: {desc}\n' |
7186b54b07c6
graft: use revs to make tests more readable
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
15506
diff
changeset
|
184 |
@ test@11: 3 |
15361 | 185 |
| |
15507
7186b54b07c6
graft: use revs to make tests more readable
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
15506
diff
changeset
|
186 |
o test@10: 4 |
15361 | 187 |
| |
15507
7186b54b07c6
graft: use revs to make tests more readable
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
15506
diff
changeset
|
188 |
o test@9: 5 |
15361 | 189 |
| |
15507
7186b54b07c6
graft: use revs to make tests more readable
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
15506
diff
changeset
|
190 |
o bar@8: 1 |
15361 | 191 |
| |
15507
7186b54b07c6
graft: use revs to make tests more readable
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
15506
diff
changeset
|
192 |
o foo@7: 2 |
15361 | 193 |
| |
15507
7186b54b07c6
graft: use revs to make tests more readable
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
15506
diff
changeset
|
194 |
| o test@6: 6 |
15361 | 195 |
| |\ |
15507
7186b54b07c6
graft: use revs to make tests more readable
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
15506
diff
changeset
|
196 |
| | o test@5: 5 |
15361 | 197 |
| | | |
15507
7186b54b07c6
graft: use revs to make tests more readable
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
15506
diff
changeset
|
198 |
| o | test@4: 4 |
15361 | 199 |
| |/ |
15507
7186b54b07c6
graft: use revs to make tests more readable
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
15506
diff
changeset
|
200 |
| o baz@3: 3 |
15361 | 201 |
| | |
15507
7186b54b07c6
graft: use revs to make tests more readable
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
15506
diff
changeset
|
202 |
| o test@2: 2 |
15361 | 203 |
| | |
15507
7186b54b07c6
graft: use revs to make tests more readable
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
15506
diff
changeset
|
204 |
| o bar@1: 1 |
15361 | 205 |
|/ |
15507
7186b54b07c6
graft: use revs to make tests more readable
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
15506
diff
changeset
|
206 |
o test@0: 0 |
15361 | 207 |
|
15506
dc9fb7015d7f
graft: preserve original source in subsequent grafts
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
15361
diff
changeset
|
208 |
Graft again onto another branch should preserve the original source |
dc9fb7015d7f
graft: preserve original source in subsequent grafts
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
15361
diff
changeset
|
209 |
$ hg up -q 0 |
dc9fb7015d7f
graft: preserve original source in subsequent grafts
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
15361
diff
changeset
|
210 |
$ echo 'g'>g |
dc9fb7015d7f
graft: preserve original source in subsequent grafts
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
15361
diff
changeset
|
211 |
$ hg add g |
dc9fb7015d7f
graft: preserve original source in subsequent grafts
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
15361
diff
changeset
|
212 |
$ hg ci -m 7 |
dc9fb7015d7f
graft: preserve original source in subsequent grafts
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
15361
diff
changeset
|
213 |
created new head |
dc9fb7015d7f
graft: preserve original source in subsequent grafts
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
15361
diff
changeset
|
214 |
$ hg graft 7 |
dc9fb7015d7f
graft: preserve original source in subsequent grafts
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
15361
diff
changeset
|
215 |
grafting revision 7 |
dc9fb7015d7f
graft: preserve original source in subsequent grafts
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
15361
diff
changeset
|
216 |
|
dc9fb7015d7f
graft: preserve original source in subsequent grafts
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
15361
diff
changeset
|
217 |
$ hg log -r 7 --template '{rev}:{node}\n' |
dc9fb7015d7f
graft: preserve original source in subsequent grafts
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
15361
diff
changeset
|
218 |
7:d2e44c99fd3f31c176ea4efb9eca9f6306c81756 |
dc9fb7015d7f
graft: preserve original source in subsequent grafts
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
15361
diff
changeset
|
219 |
$ hg log -r 2 --template '{rev}:{node}\n' |
dc9fb7015d7f
graft: preserve original source in subsequent grafts
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
15361
diff
changeset
|
220 |
2:5c095ad7e90f871700f02dd1fa5012cb4498a2d4 |
dc9fb7015d7f
graft: preserve original source in subsequent grafts
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
15361
diff
changeset
|
221 |
|
dc9fb7015d7f
graft: preserve original source in subsequent grafts
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
15361
diff
changeset
|
222 |
$ hg log --debug -r tip |
dc9fb7015d7f
graft: preserve original source in subsequent grafts
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
15361
diff
changeset
|
223 |
changeset: 13:39bb1d13572759bd1e6fc874fed1b12ece047a18 |
dc9fb7015d7f
graft: preserve original source in subsequent grafts
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
15361
diff
changeset
|
224 |
tag: tip |
dc9fb7015d7f
graft: preserve original source in subsequent grafts
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
15361
diff
changeset
|
225 |
parent: 12:b592ea63bb0c19a6c5c44685ee29a2284f9f1b8f |
dc9fb7015d7f
graft: preserve original source in subsequent grafts
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
15361
diff
changeset
|
226 |
parent: -1:0000000000000000000000000000000000000000 |
dc9fb7015d7f
graft: preserve original source in subsequent grafts
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
15361
diff
changeset
|
227 |
manifest: 13:0780e055d8f4cd12eadd5a2719481648f336f7a9 |
dc9fb7015d7f
graft: preserve original source in subsequent grafts
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
15361
diff
changeset
|
228 |
user: foo |
dc9fb7015d7f
graft: preserve original source in subsequent grafts
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
15361
diff
changeset
|
229 |
date: Thu Jan 01 00:00:00 1970 +0000 |
dc9fb7015d7f
graft: preserve original source in subsequent grafts
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
15361
diff
changeset
|
230 |
files+: b |
dc9fb7015d7f
graft: preserve original source in subsequent grafts
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
15361
diff
changeset
|
231 |
files-: a |
dc9fb7015d7f
graft: preserve original source in subsequent grafts
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
15361
diff
changeset
|
232 |
extra: branch=default |
dc9fb7015d7f
graft: preserve original source in subsequent grafts
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
15361
diff
changeset
|
233 |
extra: source=5c095ad7e90f871700f02dd1fa5012cb4498a2d4 |
dc9fb7015d7f
graft: preserve original source in subsequent grafts
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
15361
diff
changeset
|
234 |
description: |
dc9fb7015d7f
graft: preserve original source in subsequent grafts
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
15361
diff
changeset
|
235 |
2 |
dc9fb7015d7f
graft: preserve original source in subsequent grafts
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
15361
diff
changeset
|
236 |
|
dc9fb7015d7f
graft: preserve original source in subsequent grafts
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
15361
diff
changeset
|
237 |
|
15508
00276525e2b7
graft: disallow grafting grafted csets in specific situations (issue3091)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
15507
diff
changeset
|
238 |
Disallow grafting an already grafted cset onto its original branch |
00276525e2b7
graft: disallow grafting grafted csets in specific situations (issue3091)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
15507
diff
changeset
|
239 |
$ hg up -q 6 |
00276525e2b7
graft: disallow grafting grafted csets in specific situations (issue3091)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
15507
diff
changeset
|
240 |
$ hg graft 7 |
00276525e2b7
graft: disallow grafting grafted csets in specific situations (issue3091)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
15507
diff
changeset
|
241 |
skipping already grafted revision 7 (was grafted from 2) |
00276525e2b7
graft: disallow grafting grafted csets in specific situations (issue3091)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
15507
diff
changeset
|
242 |
[255] |
00276525e2b7
graft: disallow grafting grafted csets in specific situations (issue3091)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
15507
diff
changeset
|
243 |
|
00276525e2b7
graft: disallow grafting grafted csets in specific situations (issue3091)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
15507
diff
changeset
|
244 |
Disallow grafting already grafted csets with the same origin onto each other |
00276525e2b7
graft: disallow grafting grafted csets in specific situations (issue3091)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
15507
diff
changeset
|
245 |
$ hg up -q 13 |
00276525e2b7
graft: disallow grafting grafted csets in specific situations (issue3091)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
15507
diff
changeset
|
246 |
$ hg graft 2 |
00276525e2b7
graft: disallow grafting grafted csets in specific situations (issue3091)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
15507
diff
changeset
|
247 |
skipping already grafted revision 2 |
00276525e2b7
graft: disallow grafting grafted csets in specific situations (issue3091)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
15507
diff
changeset
|
248 |
[255] |
00276525e2b7
graft: disallow grafting grafted csets in specific situations (issue3091)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
15507
diff
changeset
|
249 |
$ hg graft 7 |
00276525e2b7
graft: disallow grafting grafted csets in specific situations (issue3091)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
15507
diff
changeset
|
250 |
skipping already grafted revision 7 (same origin 2) |
00276525e2b7
graft: disallow grafting grafted csets in specific situations (issue3091)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
15507
diff
changeset
|
251 |
[255] |
00276525e2b7
graft: disallow grafting grafted csets in specific situations (issue3091)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
15507
diff
changeset
|
252 |
|
00276525e2b7
graft: disallow grafting grafted csets in specific situations (issue3091)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
15507
diff
changeset
|
253 |
$ hg up -q 7 |
00276525e2b7
graft: disallow grafting grafted csets in specific situations (issue3091)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
15507
diff
changeset
|
254 |
$ hg graft 2 |
00276525e2b7
graft: disallow grafting grafted csets in specific situations (issue3091)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
15507
diff
changeset
|
255 |
skipping already grafted revision 2 |
00276525e2b7
graft: disallow grafting grafted csets in specific situations (issue3091)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
15507
diff
changeset
|
256 |
[255] |
00276525e2b7
graft: disallow grafting grafted csets in specific situations (issue3091)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
15507
diff
changeset
|
257 |
$ hg graft tip |
00276525e2b7
graft: disallow grafting grafted csets in specific situations (issue3091)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
15507
diff
changeset
|
258 |
skipping already grafted revision 13 (same origin 2) |
00276525e2b7
graft: disallow grafting grafted csets in specific situations (issue3091)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
15507
diff
changeset
|
259 |
[255] |