Show More
@@ -1,352 +1,365 b'' | |||
|
1 | 1 | Criss cross merging |
|
2 | 2 | |
|
3 | 3 | $ hg init criss-cross |
|
4 | 4 | $ cd criss-cross |
|
5 | 5 | $ echo '0 base' > f1 |
|
6 | 6 | $ echo '0 base' > f2 |
|
7 | 7 | $ hg ci -Aqm '0 base' |
|
8 | 8 | |
|
9 | 9 | $ echo '1 first change' > f1 |
|
10 | 10 | $ hg ci -m '1 first change f1' |
|
11 | 11 | |
|
12 | 12 | $ hg up -qr0 |
|
13 | 13 | $ echo '2 first change' > f2 |
|
14 | 14 | $ hg ci -qm '2 first change f2' |
|
15 | 15 | |
|
16 | 16 | $ hg merge -qr 1 |
|
17 | 17 | $ hg ci -m '3 merge' |
|
18 | 18 | |
|
19 | 19 | $ hg up -qr2 |
|
20 | 20 | $ hg merge -qr1 |
|
21 | 21 | $ hg ci -qm '4 merge' |
|
22 | 22 | |
|
23 | 23 | $ echo '5 second change' > f1 |
|
24 | 24 | $ hg ci -m '5 second change f1' |
|
25 | 25 | |
|
26 | 26 | $ hg up -r3 |
|
27 | 27 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
28 | 28 | $ echo '6 second change' > f2 |
|
29 | 29 | $ hg ci -m '6 second change f2' |
|
30 | 30 | |
|
31 | 31 | $ hg log -G |
|
32 | 32 | @ changeset: 6:3b08d01b0ab5 |
|
33 | 33 | | tag: tip |
|
34 | 34 | | parent: 3:cf89f02107e5 |
|
35 | 35 | | user: test |
|
36 | 36 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
37 | 37 | | summary: 6 second change f2 |
|
38 | 38 | | |
|
39 | 39 | | o changeset: 5:adfe50279922 |
|
40 | 40 | | | user: test |
|
41 | 41 | | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
42 | 42 | | | summary: 5 second change f1 |
|
43 | 43 | | | |
|
44 | 44 | | o changeset: 4:7d3e55501ae6 |
|
45 | 45 | | |\ parent: 2:40663881a6dd |
|
46 | 46 | | | | parent: 1:0f6b37dbe527 |
|
47 | 47 | | | | user: test |
|
48 | 48 | | | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
49 | 49 | | | | summary: 4 merge |
|
50 | 50 | | | | |
|
51 | 51 | o---+ changeset: 3:cf89f02107e5 |
|
52 | 52 | | | | parent: 2:40663881a6dd |
|
53 | 53 | |/ / parent: 1:0f6b37dbe527 |
|
54 | 54 | | | user: test |
|
55 | 55 | | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
56 | 56 | | | summary: 3 merge |
|
57 | 57 | | | |
|
58 | 58 | | o changeset: 2:40663881a6dd |
|
59 | 59 | | | parent: 0:40494bf2444c |
|
60 | 60 | | | user: test |
|
61 | 61 | | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
62 | 62 | | | summary: 2 first change f2 |
|
63 | 63 | | | |
|
64 | 64 | o | changeset: 1:0f6b37dbe527 |
|
65 | 65 | |/ user: test |
|
66 | 66 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
67 | 67 | | summary: 1 first change f1 |
|
68 | 68 | | |
|
69 | 69 | o changeset: 0:40494bf2444c |
|
70 | 70 | user: test |
|
71 | 71 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
72 | 72 | summary: 0 base |
|
73 | 73 | |
|
74 | 74 | |
|
75 | 75 | $ hg merge -v --debug --tool internal:dump 5 --config merge.preferancestor='!' |
|
76 | 76 | note: using 0f6b37dbe527 as ancestor of 3b08d01b0ab5 and adfe50279922 |
|
77 | 77 | alternatively, use --config merge.preferancestor=40663881a6dd |
|
78 | 78 | searching for copies back to rev 3 |
|
79 | 79 | resolving manifests |
|
80 | 80 | branchmerge: True, force: False, partial: False |
|
81 | 81 | ancestor: 0f6b37dbe527, local: 3b08d01b0ab5+, remote: adfe50279922 |
|
82 | 82 | preserving f2 for resolve of f2 |
|
83 | 83 | f1: remote is newer -> g |
|
84 | 84 | getting f1 |
|
85 | 85 | f2: versions differ -> m (premerge) |
|
86 | 86 | picked tool ':dump' for f2 (binary False symlink False changedelete False) |
|
87 | 87 | merging f2 |
|
88 | 88 | my f2@3b08d01b0ab5+ other f2@adfe50279922 ancestor f2@0f6b37dbe527 |
|
89 | 89 | f2: versions differ -> m (merge) |
|
90 | 90 | picked tool ':dump' for f2 (binary False symlink False changedelete False) |
|
91 | 91 | my f2@3b08d01b0ab5+ other f2@adfe50279922 ancestor f2@0f6b37dbe527 |
|
92 | 92 | 1 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
93 | 93 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon |
|
94 | 94 | [1] |
|
95 | 95 | |
|
96 | $ head * | |
|
97 | ==> f1 <== | |
|
96 | $ f --dump * | |
|
97 | f1: | |
|
98 | >>> | |
|
98 | 99 | 5 second change |
|
99 | ||
|
100 | ==> f2 <== | |
|
100 | <<< | |
|
101 | f2: | |
|
102 | >>> | |
|
101 | 103 | 6 second change |
|
102 | ||
|
103 |
|
|
|
104 | <<< | |
|
105 | f2.base: | |
|
106 | >>> | |
|
104 | 107 | 0 base |
|
105 | ||
|
106 |
|
|
|
108 | <<< | |
|
109 | f2.local: | |
|
110 | >>> | |
|
107 | 111 | 6 second change |
|
108 | ||
|
109 |
|
|
|
112 | <<< | |
|
113 | f2.orig: | |
|
114 | >>> | |
|
110 | 115 | 6 second change |
|
111 | ||
|
112 |
|
|
|
116 | <<< | |
|
117 | f2.other: | |
|
118 | >>> | |
|
113 | 119 | 2 first change |
|
120 | <<< | |
|
114 | 121 | |
|
115 | 122 | $ hg up -qC . |
|
116 | 123 | $ hg merge -v --tool internal:dump 5 --config merge.preferancestor="null 40663881 3b08d" |
|
117 | 124 | note: using 40663881a6dd as ancestor of 3b08d01b0ab5 and adfe50279922 |
|
118 | 125 | alternatively, use --config merge.preferancestor=0f6b37dbe527 |
|
119 | 126 | resolving manifests |
|
120 | 127 | merging f1 |
|
121 | 128 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
122 | 129 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon |
|
123 | 130 | [1] |
|
124 | 131 | |
|
125 | 132 | Redo merge with merge.preferancestor="*" to enable bid merge |
|
126 | 133 | |
|
127 | 134 | $ rm f* |
|
128 | 135 | $ hg up -qC . |
|
129 | 136 | $ hg merge -v --debug --tool internal:dump 5 --config merge.preferancestor="*" |
|
130 | 137 | note: merging 3b08d01b0ab5+ and adfe50279922 using bids from ancestors 0f6b37dbe527 and 40663881a6dd |
|
131 | 138 | |
|
132 | 139 | calculating bids for ancestor 0f6b37dbe527 |
|
133 | 140 | searching for copies back to rev 3 |
|
134 | 141 | resolving manifests |
|
135 | 142 | branchmerge: True, force: False, partial: False |
|
136 | 143 | ancestor: 0f6b37dbe527, local: 3b08d01b0ab5+, remote: adfe50279922 |
|
137 | 144 | f1: remote is newer -> g |
|
138 | 145 | f2: versions differ -> m |
|
139 | 146 | |
|
140 | 147 | calculating bids for ancestor 40663881a6dd |
|
141 | 148 | searching for copies back to rev 3 |
|
142 | 149 | resolving manifests |
|
143 | 150 | branchmerge: True, force: False, partial: False |
|
144 | 151 | ancestor: 40663881a6dd, local: 3b08d01b0ab5+, remote: adfe50279922 |
|
145 | 152 | f1: versions differ -> m |
|
146 | 153 | f2: remote unchanged -> k |
|
147 | 154 | |
|
148 | 155 | auction for merging merge bids |
|
149 | 156 | f1: picking 'get' action |
|
150 | 157 | f2: picking 'keep' action |
|
151 | 158 | end of auction |
|
152 | 159 | |
|
153 | 160 | f1: remote is newer -> g |
|
154 | 161 | getting f1 |
|
155 | 162 | f2: remote unchanged -> k |
|
156 | 163 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
157 | 164 | (branch merge, don't forget to commit) |
|
158 | 165 | |
|
159 | $ head * | |
|
160 | ==> f1 <== | |
|
166 | $ f --dump * | |
|
167 | f1: | |
|
168 | >>> | |
|
161 | 169 | 5 second change |
|
162 | ||
|
163 | ==> f2 <== | |
|
170 | <<< | |
|
171 | f2: | |
|
172 | >>> | |
|
164 | 173 | 6 second change |
|
174 | <<< | |
|
165 | 175 | |
|
166 | 176 | |
|
167 | 177 | The other way around: |
|
168 | 178 | |
|
169 | 179 | $ hg up -C -r5 |
|
170 | 180 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
171 | 181 | $ hg merge -v --debug --config merge.preferancestor="*" |
|
172 | 182 |
note: merging adfe50279922+ and 3b08d01b0ab5 using bids from ancestors 0f6b37dbe527 and |
|
173 | 183 | |
|
174 | 184 |
calculating bids for ancestor |
|
175 | 185 | searching for copies back to rev 3 |
|
176 | 186 | resolving manifests |
|
177 | 187 | branchmerge: True, force: False, partial: False |
|
178 | 188 |
ancestor: 0f6b37dbe527, local: adfe50279922+, remote: |
|
179 | 189 | f1: remote unchanged -> k |
|
180 | 190 | f2: versions differ -> m |
|
181 | 191 | |
|
182 | 192 | calculating bids for ancestor 40663881a6dd |
|
183 | 193 | searching for copies back to rev 3 |
|
184 | 194 | resolving manifests |
|
185 | 195 | branchmerge: True, force: False, partial: False |
|
186 | 196 | ancestor: 40663881a6dd, local: adfe50279922+, remote: 3b08d01b0ab5 |
|
187 | 197 | f1: versions differ -> m |
|
188 | 198 | f2: remote is newer -> g |
|
189 | 199 | |
|
190 | 200 | auction for merging merge bids |
|
191 | 201 | f1: picking 'keep' action |
|
192 | 202 | f2: picking 'get' action |
|
193 | 203 | end of auction |
|
194 | 204 | |
|
195 | 205 | f2: remote is newer -> g |
|
196 | 206 | getting f2 |
|
197 | 207 | f1: remote unchanged -> k |
|
198 | 208 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
199 | 209 | (branch merge, don't forget to commit) |
|
200 | 210 | |
|
201 | $ head * | |
|
202 | ==> f1 <== | |
|
211 | $ f --dump * | |
|
212 | f1: | |
|
213 | >>> | |
|
203 | 214 | 5 second change |
|
204 | ||
|
205 | ==> f2 <== | |
|
215 | <<< | |
|
216 | f2: | |
|
217 | >>> | |
|
206 | 218 | 6 second change |
|
219 | <<< | |
|
207 | 220 | |
|
208 | 221 | Verify how the output looks and and how verbose it is: |
|
209 | 222 | |
|
210 | 223 | $ hg up -qC |
|
211 | 224 | $ hg merge |
|
212 | 225 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
213 | 226 | (branch merge, don't forget to commit) |
|
214 | 227 | |
|
215 | 228 | $ hg up -qC tip |
|
216 | 229 | $ hg merge -v |
|
217 | 230 | note: merging 3b08d01b0ab5+ and adfe50279922 using bids from ancestors 0f6b37dbe527 and 40663881a6dd |
|
218 | 231 | |
|
219 | 232 | calculating bids for ancestor 0f6b37dbe527 |
|
220 | 233 | resolving manifests |
|
221 | 234 | |
|
222 | 235 | calculating bids for ancestor 40663881a6dd |
|
223 | 236 | resolving manifests |
|
224 | 237 | |
|
225 | 238 | auction for merging merge bids |
|
226 | 239 | f1: picking 'get' action |
|
227 | 240 | f2: picking 'keep' action |
|
228 | 241 | end of auction |
|
229 | 242 | |
|
230 | 243 | getting f1 |
|
231 | 244 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
232 | 245 | (branch merge, don't forget to commit) |
|
233 | 246 | |
|
234 | 247 | $ hg up -qC |
|
235 | 248 | $ hg merge -v --debug --config merge.preferancestor="*" |
|
236 | 249 | note: merging 3b08d01b0ab5+ and adfe50279922 using bids from ancestors 0f6b37dbe527 and 40663881a6dd |
|
237 | 250 | |
|
238 | 251 | calculating bids for ancestor 0f6b37dbe527 |
|
239 | 252 | searching for copies back to rev 3 |
|
240 | 253 | resolving manifests |
|
241 | 254 | branchmerge: True, force: False, partial: False |
|
242 | 255 | ancestor: 0f6b37dbe527, local: 3b08d01b0ab5+, remote: adfe50279922 |
|
243 | 256 | f1: remote is newer -> g |
|
244 | 257 | f2: versions differ -> m |
|
245 | 258 | |
|
246 | 259 | calculating bids for ancestor 40663881a6dd |
|
247 | 260 | searching for copies back to rev 3 |
|
248 | 261 | resolving manifests |
|
249 | 262 | branchmerge: True, force: False, partial: False |
|
250 | 263 | ancestor: 40663881a6dd, local: 3b08d01b0ab5+, remote: adfe50279922 |
|
251 | 264 | f1: versions differ -> m |
|
252 | 265 | f2: remote unchanged -> k |
|
253 | 266 | |
|
254 | 267 | auction for merging merge bids |
|
255 | 268 | f1: picking 'get' action |
|
256 | 269 | f2: picking 'keep' action |
|
257 | 270 | end of auction |
|
258 | 271 | |
|
259 | 272 | f1: remote is newer -> g |
|
260 | 273 | getting f1 |
|
261 | 274 | f2: remote unchanged -> k |
|
262 | 275 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
263 | 276 | (branch merge, don't forget to commit) |
|
264 | 277 | |
|
265 | 278 | $ cd .. |
|
266 | 279 | |
|
267 | 280 | http://stackoverflow.com/questions/9350005/how-do-i-specify-a-merge-base-to-use-in-a-hg-merge/9430810 |
|
268 | 281 | |
|
269 | 282 | $ hg init ancestor-merging |
|
270 | 283 | $ cd ancestor-merging |
|
271 | 284 | $ echo a > x |
|
272 | 285 | $ hg commit -A -m a x |
|
273 | 286 | $ hg update -q 0 |
|
274 | 287 | $ echo b >> x |
|
275 | 288 | $ hg commit -m b |
|
276 | 289 | $ hg update -q 0 |
|
277 | 290 | $ echo c >> x |
|
278 | 291 | $ hg commit -qm c |
|
279 | 292 | $ hg update -q 1 |
|
280 | 293 | $ hg merge -q --tool internal:local 2 |
|
281 | 294 | $ echo c >> x |
|
282 | 295 | $ hg commit -m bc |
|
283 | 296 | $ hg update -q 2 |
|
284 | 297 | $ hg merge -q --tool internal:local 1 |
|
285 | 298 | $ echo b >> x |
|
286 | 299 | $ hg commit -qm cb |
|
287 | 300 | |
|
288 | 301 | $ hg merge --config merge.preferancestor='!' |
|
289 | 302 | note: using 70008a2163f6 as ancestor of 0d355fdef312 and 4b8b546a3eef |
|
290 | 303 | alternatively, use --config merge.preferancestor=b211bbc6eb3c |
|
291 | 304 | merging x |
|
292 | 305 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
293 | 306 | (branch merge, don't forget to commit) |
|
294 | 307 | $ cat x |
|
295 | 308 | a |
|
296 | 309 | c |
|
297 | 310 | b |
|
298 | 311 | c |
|
299 | 312 | |
|
300 | 313 | $ hg up -qC . |
|
301 | 314 | |
|
302 | 315 | $ hg merge --config merge.preferancestor=b211bbc6eb3c |
|
303 | 316 | note: using b211bbc6eb3c as ancestor of 0d355fdef312 and 4b8b546a3eef |
|
304 | 317 | alternatively, use --config merge.preferancestor=70008a2163f6 |
|
305 | 318 | merging x |
|
306 | 319 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
307 | 320 | (branch merge, don't forget to commit) |
|
308 | 321 | $ cat x |
|
309 | 322 | a |
|
310 | 323 | b |
|
311 | 324 | c |
|
312 | 325 | b |
|
313 | 326 | |
|
314 | 327 | $ hg up -qC . |
|
315 | 328 | |
|
316 | 329 | $ hg merge -v --config merge.preferancestor="*" |
|
317 | 330 | note: merging 0d355fdef312+ and 4b8b546a3eef using bids from ancestors 70008a2163f6 and b211bbc6eb3c |
|
318 | 331 | |
|
319 | 332 | calculating bids for ancestor 70008a2163f6 |
|
320 | 333 | resolving manifests |
|
321 | 334 | |
|
322 | 335 | calculating bids for ancestor b211bbc6eb3c |
|
323 | 336 | resolving manifests |
|
324 | 337 | |
|
325 | 338 | auction for merging merge bids |
|
326 | 339 | x: multiple bids for merge action: |
|
327 | 340 | versions differ -> m |
|
328 | 341 | versions differ -> m |
|
329 | 342 | x: ambiguous merge - picked m action |
|
330 | 343 | end of auction |
|
331 | 344 | |
|
332 | 345 | merging x |
|
333 | 346 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
334 | 347 | (branch merge, don't forget to commit) |
|
335 | 348 | $ cat x |
|
336 | 349 | a |
|
337 | 350 | c |
|
338 | 351 | b |
|
339 | 352 | c |
|
340 | 353 | |
|
341 | 354 | Verify that the old context ancestor works with / despite preferancestor: |
|
342 | 355 | |
|
343 | 356 | $ hg log -r 'ancestor(head())' --config merge.preferancestor=1 -T '{rev}\n' |
|
344 | 357 | 1 |
|
345 | 358 | $ hg log -r 'ancestor(head())' --config merge.preferancestor=2 -T '{rev}\n' |
|
346 | 359 | 2 |
|
347 | 360 | $ hg log -r 'ancestor(head())' --config merge.preferancestor=3 -T '{rev}\n' |
|
348 | 361 | 1 |
|
349 | 362 | $ hg log -r 'ancestor(head())' --config merge.preferancestor='1337 * - 2' -T '{rev}\n' |
|
350 | 363 | 2 |
|
351 | 364 | |
|
352 | 365 | $ cd .. |
General Comments 0
You need to be logged in to leave comments.
Login now