##// END OF EJS Templates
tests: add criss cross merging tests whose behavior need to be fixed...
marmoute -
r46037:9bd60ec6 default
parent child Browse files
Show More
@@ -1,471 +1,693 b''
1 Criss cross merging
1 Criss cross merging
2
2
3 $ hg init criss-cross
3 $ hg init criss-cross
4 $ cd criss-cross
4 $ cd criss-cross
5 $ echo '0 base' > f1
5 $ echo '0 base' > f1
6 $ echo '0 base' > f2
6 $ echo '0 base' > f2
7 $ hg ci -Aqm '0 base'
7 $ hg ci -Aqm '0 base'
8
8
9 $ echo '1 first change' > f1
9 $ echo '1 first change' > f1
10 $ hg ci -m '1 first change f1'
10 $ hg ci -m '1 first change f1'
11
11
12 $ hg up -qr0
12 $ hg up -qr0
13 $ echo '2 first change' > f2
13 $ echo '2 first change' > f2
14 $ hg ci -qm '2 first change f2'
14 $ hg ci -qm '2 first change f2'
15
15
16 $ hg merge -qr 1
16 $ hg merge -qr 1
17 $ hg ci -m '3 merge'
17 $ hg ci -m '3 merge'
18
18
19 $ hg up -qr2
19 $ hg up -qr2
20 $ hg merge -qr1
20 $ hg merge -qr1
21 $ hg ci -qm '4 merge'
21 $ hg ci -qm '4 merge'
22
22
23 $ echo '5 second change' > f1
23 $ echo '5 second change' > f1
24 $ hg ci -m '5 second change f1'
24 $ hg ci -m '5 second change f1'
25
25
26 $ hg up -r3
26 $ hg up -r3
27 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
27 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
28 $ echo '6 second change' > f2
28 $ echo '6 second change' > f2
29 $ hg ci -m '6 second change f2'
29 $ hg ci -m '6 second change f2'
30
30
31 $ hg log -G
31 $ hg log -G
32 @ changeset: 6:3b08d01b0ab5
32 @ changeset: 6:3b08d01b0ab5
33 | tag: tip
33 | tag: tip
34 | parent: 3:cf89f02107e5
34 | parent: 3:cf89f02107e5
35 | user: test
35 | user: test
36 | date: Thu Jan 01 00:00:00 1970 +0000
36 | date: Thu Jan 01 00:00:00 1970 +0000
37 | summary: 6 second change f2
37 | summary: 6 second change f2
38 |
38 |
39 | o changeset: 5:adfe50279922
39 | o changeset: 5:adfe50279922
40 | | user: test
40 | | user: test
41 | | date: Thu Jan 01 00:00:00 1970 +0000
41 | | date: Thu Jan 01 00:00:00 1970 +0000
42 | | summary: 5 second change f1
42 | | summary: 5 second change f1
43 | |
43 | |
44 | o changeset: 4:7d3e55501ae6
44 | o changeset: 4:7d3e55501ae6
45 | |\ parent: 2:40663881a6dd
45 | |\ parent: 2:40663881a6dd
46 | | | parent: 1:0f6b37dbe527
46 | | | parent: 1:0f6b37dbe527
47 | | | user: test
47 | | | user: test
48 | | | date: Thu Jan 01 00:00:00 1970 +0000
48 | | | date: Thu Jan 01 00:00:00 1970 +0000
49 | | | summary: 4 merge
49 | | | summary: 4 merge
50 | | |
50 | | |
51 o---+ changeset: 3:cf89f02107e5
51 o---+ changeset: 3:cf89f02107e5
52 | | | parent: 2:40663881a6dd
52 | | | parent: 2:40663881a6dd
53 |/ / parent: 1:0f6b37dbe527
53 |/ / parent: 1:0f6b37dbe527
54 | | user: test
54 | | user: test
55 | | date: Thu Jan 01 00:00:00 1970 +0000
55 | | date: Thu Jan 01 00:00:00 1970 +0000
56 | | summary: 3 merge
56 | | summary: 3 merge
57 | |
57 | |
58 | o changeset: 2:40663881a6dd
58 | o changeset: 2:40663881a6dd
59 | | parent: 0:40494bf2444c
59 | | parent: 0:40494bf2444c
60 | | user: test
60 | | user: test
61 | | date: Thu Jan 01 00:00:00 1970 +0000
61 | | date: Thu Jan 01 00:00:00 1970 +0000
62 | | summary: 2 first change f2
62 | | summary: 2 first change f2
63 | |
63 | |
64 o | changeset: 1:0f6b37dbe527
64 o | changeset: 1:0f6b37dbe527
65 |/ user: test
65 |/ user: test
66 | date: Thu Jan 01 00:00:00 1970 +0000
66 | date: Thu Jan 01 00:00:00 1970 +0000
67 | summary: 1 first change f1
67 | summary: 1 first change f1
68 |
68 |
69 o changeset: 0:40494bf2444c
69 o changeset: 0:40494bf2444c
70 user: test
70 user: test
71 date: Thu Jan 01 00:00:00 1970 +0000
71 date: Thu Jan 01 00:00:00 1970 +0000
72 summary: 0 base
72 summary: 0 base
73
73
74
74
75 $ hg merge -v --debug --tool internal:dump 5 --config merge.preferancestor='!'
75 $ hg merge -v --debug --tool internal:dump 5 --config merge.preferancestor='!'
76 note: using 0f6b37dbe527 as ancestor of 3b08d01b0ab5 and adfe50279922
76 note: using 0f6b37dbe527 as ancestor of 3b08d01b0ab5 and adfe50279922
77 alternatively, use --config merge.preferancestor=40663881a6dd
77 alternatively, use --config merge.preferancestor=40663881a6dd
78 resolving manifests
78 resolving manifests
79 branchmerge: True, force: False, partial: False
79 branchmerge: True, force: False, partial: False
80 ancestor: 0f6b37dbe527, local: 3b08d01b0ab5+, remote: adfe50279922
80 ancestor: 0f6b37dbe527, local: 3b08d01b0ab5+, remote: adfe50279922
81 preserving f2 for resolve of f2
81 preserving f2 for resolve of f2
82 f1: remote is newer -> g
82 f1: remote is newer -> g
83 getting f1
83 getting f1
84 f2: versions differ -> m (premerge)
84 f2: versions differ -> m (premerge)
85 picked tool ':dump' for f2 (binary False symlink False changedelete False)
85 picked tool ':dump' for f2 (binary False symlink False changedelete False)
86 merging f2
86 merging f2
87 my f2@3b08d01b0ab5+ other f2@adfe50279922 ancestor f2@0f6b37dbe527
87 my f2@3b08d01b0ab5+ other f2@adfe50279922 ancestor f2@0f6b37dbe527
88 f2: versions differ -> m (merge)
88 f2: versions differ -> m (merge)
89 picked tool ':dump' for f2 (binary False symlink False changedelete False)
89 picked tool ':dump' for f2 (binary False symlink False changedelete False)
90 my f2@3b08d01b0ab5+ other f2@adfe50279922 ancestor f2@0f6b37dbe527
90 my f2@3b08d01b0ab5+ other f2@adfe50279922 ancestor f2@0f6b37dbe527
91 1 files updated, 0 files merged, 0 files removed, 1 files unresolved
91 1 files updated, 0 files merged, 0 files removed, 1 files unresolved
92 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
92 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
93 [1]
93 [1]
94
94
95 $ f --dump *
95 $ f --dump *
96 f1:
96 f1:
97 >>>
97 >>>
98 5 second change
98 5 second change
99 <<<
99 <<<
100 f2:
100 f2:
101 >>>
101 >>>
102 6 second change
102 6 second change
103 <<<
103 <<<
104 f2.base:
104 f2.base:
105 >>>
105 >>>
106 0 base
106 0 base
107 <<<
107 <<<
108 f2.local:
108 f2.local:
109 >>>
109 >>>
110 6 second change
110 6 second change
111 <<<
111 <<<
112 f2.orig:
112 f2.orig:
113 >>>
113 >>>
114 6 second change
114 6 second change
115 <<<
115 <<<
116 f2.other:
116 f2.other:
117 >>>
117 >>>
118 2 first change
118 2 first change
119 <<<
119 <<<
120
120
121 $ hg up -qC .
121 $ hg up -qC .
122 $ hg merge -v --tool internal:dump 5 --config merge.preferancestor="null 40663881 3b08d"
122 $ hg merge -v --tool internal:dump 5 --config merge.preferancestor="null 40663881 3b08d"
123 note: using 40663881a6dd as ancestor of 3b08d01b0ab5 and adfe50279922
123 note: using 40663881a6dd as ancestor of 3b08d01b0ab5 and adfe50279922
124 alternatively, use --config merge.preferancestor=0f6b37dbe527
124 alternatively, use --config merge.preferancestor=0f6b37dbe527
125 resolving manifests
125 resolving manifests
126 merging f1
126 merging f1
127 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
127 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
128 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
128 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
129 [1]
129 [1]
130
130
131 Redo merge with merge.preferancestor="*" to enable bid merge
131 Redo merge with merge.preferancestor="*" to enable bid merge
132
132
133 $ rm f*
133 $ rm f*
134 $ hg up -qC .
134 $ hg up -qC .
135 $ hg merge -v --debug --tool internal:dump 5 --config merge.preferancestor="*"
135 $ hg merge -v --debug --tool internal:dump 5 --config merge.preferancestor="*"
136 note: merging 3b08d01b0ab5+ and adfe50279922 using bids from ancestors 0f6b37dbe527 and 40663881a6dd
136 note: merging 3b08d01b0ab5+ and adfe50279922 using bids from ancestors 0f6b37dbe527 and 40663881a6dd
137
137
138 calculating bids for ancestor 0f6b37dbe527
138 calculating bids for ancestor 0f6b37dbe527
139 resolving manifests
139 resolving manifests
140 branchmerge: True, force: False, partial: False
140 branchmerge: True, force: False, partial: False
141 ancestor: 0f6b37dbe527, local: 3b08d01b0ab5+, remote: adfe50279922
141 ancestor: 0f6b37dbe527, local: 3b08d01b0ab5+, remote: adfe50279922
142 f1: remote is newer -> g
142 f1: remote is newer -> g
143 f2: versions differ -> m
143 f2: versions differ -> m
144
144
145 calculating bids for ancestor 40663881a6dd
145 calculating bids for ancestor 40663881a6dd
146 resolving manifests
146 resolving manifests
147 branchmerge: True, force: False, partial: False
147 branchmerge: True, force: False, partial: False
148 ancestor: 40663881a6dd, local: 3b08d01b0ab5+, remote: adfe50279922
148 ancestor: 40663881a6dd, local: 3b08d01b0ab5+, remote: adfe50279922
149 f1: versions differ -> m
149 f1: versions differ -> m
150 f2: remote unchanged -> k
150 f2: remote unchanged -> k
151
151
152 auction for merging merge bids (2 ancestors)
152 auction for merging merge bids (2 ancestors)
153 list of bids for f1:
153 list of bids for f1:
154 remote is newer -> g
154 remote is newer -> g
155 versions differ -> m
155 versions differ -> m
156 f1: picking 'get' action
156 f1: picking 'get' action
157 list of bids for f2:
157 list of bids for f2:
158 remote unchanged -> k
158 remote unchanged -> k
159 versions differ -> m
159 versions differ -> m
160 f2: picking 'keep' action
160 f2: picking 'keep' action
161 end of auction
161 end of auction
162
162
163 f1: remote is newer -> g
163 f1: remote is newer -> g
164 getting f1
164 getting f1
165 f2: remote unchanged -> k
165 f2: remote unchanged -> k
166 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
166 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
167 (branch merge, don't forget to commit)
167 (branch merge, don't forget to commit)
168
168
169 $ f --dump *
169 $ f --dump *
170 f1:
170 f1:
171 >>>
171 >>>
172 5 second change
172 5 second change
173 <<<
173 <<<
174 f2:
174 f2:
175 >>>
175 >>>
176 6 second change
176 6 second change
177 <<<
177 <<<
178
178
179
179
180 The other way around:
180 The other way around:
181
181
182 $ hg up -C -r5
182 $ hg up -C -r5
183 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
183 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
184 $ hg merge -v --debug --config merge.preferancestor="*"
184 $ hg merge -v --debug --config merge.preferancestor="*"
185 note: merging adfe50279922+ and 3b08d01b0ab5 using bids from ancestors 0f6b37dbe527 and 40663881a6dd
185 note: merging adfe50279922+ and 3b08d01b0ab5 using bids from ancestors 0f6b37dbe527 and 40663881a6dd
186
186
187 calculating bids for ancestor 0f6b37dbe527
187 calculating bids for ancestor 0f6b37dbe527
188 resolving manifests
188 resolving manifests
189 branchmerge: True, force: False, partial: False
189 branchmerge: True, force: False, partial: False
190 ancestor: 0f6b37dbe527, local: adfe50279922+, remote: 3b08d01b0ab5
190 ancestor: 0f6b37dbe527, local: adfe50279922+, remote: 3b08d01b0ab5
191 f1: remote unchanged -> k
191 f1: remote unchanged -> k
192 f2: versions differ -> m
192 f2: versions differ -> m
193
193
194 calculating bids for ancestor 40663881a6dd
194 calculating bids for ancestor 40663881a6dd
195 resolving manifests
195 resolving manifests
196 branchmerge: True, force: False, partial: False
196 branchmerge: True, force: False, partial: False
197 ancestor: 40663881a6dd, local: adfe50279922+, remote: 3b08d01b0ab5
197 ancestor: 40663881a6dd, local: adfe50279922+, remote: 3b08d01b0ab5
198 f1: versions differ -> m
198 f1: versions differ -> m
199 f2: remote is newer -> g
199 f2: remote is newer -> g
200
200
201 auction for merging merge bids (2 ancestors)
201 auction for merging merge bids (2 ancestors)
202 list of bids for f1:
202 list of bids for f1:
203 remote unchanged -> k
203 remote unchanged -> k
204 versions differ -> m
204 versions differ -> m
205 f1: picking 'keep' action
205 f1: picking 'keep' action
206 list of bids for f2:
206 list of bids for f2:
207 remote is newer -> g
207 remote is newer -> g
208 versions differ -> m
208 versions differ -> m
209 f2: picking 'get' action
209 f2: picking 'get' action
210 end of auction
210 end of auction
211
211
212 f2: remote is newer -> g
212 f2: remote is newer -> g
213 getting f2
213 getting f2
214 f1: remote unchanged -> k
214 f1: remote unchanged -> k
215 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
215 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
216 (branch merge, don't forget to commit)
216 (branch merge, don't forget to commit)
217
217
218 $ f --dump *
218 $ f --dump *
219 f1:
219 f1:
220 >>>
220 >>>
221 5 second change
221 5 second change
222 <<<
222 <<<
223 f2:
223 f2:
224 >>>
224 >>>
225 6 second change
225 6 second change
226 <<<
226 <<<
227
227
228 Verify how the output looks and and how verbose it is:
228 Verify how the output looks and and how verbose it is:
229
229
230 $ hg up -qC
230 $ hg up -qC
231 $ hg merge
231 $ hg merge
232 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
232 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
233 (branch merge, don't forget to commit)
233 (branch merge, don't forget to commit)
234
234
235 $ hg up -qC tip
235 $ hg up -qC tip
236 $ hg merge -v
236 $ hg merge -v
237 note: merging 3b08d01b0ab5+ and adfe50279922 using bids from ancestors 0f6b37dbe527 and 40663881a6dd
237 note: merging 3b08d01b0ab5+ and adfe50279922 using bids from ancestors 0f6b37dbe527 and 40663881a6dd
238
238
239 calculating bids for ancestor 0f6b37dbe527
239 calculating bids for ancestor 0f6b37dbe527
240 resolving manifests
240 resolving manifests
241
241
242 calculating bids for ancestor 40663881a6dd
242 calculating bids for ancestor 40663881a6dd
243 resolving manifests
243 resolving manifests
244
244
245 auction for merging merge bids (2 ancestors)
245 auction for merging merge bids (2 ancestors)
246 f1: picking 'get' action
246 f1: picking 'get' action
247 f2: picking 'keep' action
247 f2: picking 'keep' action
248 end of auction
248 end of auction
249
249
250 getting f1
250 getting f1
251 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
251 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
252 (branch merge, don't forget to commit)
252 (branch merge, don't forget to commit)
253
253
254 $ hg up -qC
254 $ hg up -qC
255 $ hg merge -v --debug --config merge.preferancestor="*"
255 $ hg merge -v --debug --config merge.preferancestor="*"
256 note: merging 3b08d01b0ab5+ and adfe50279922 using bids from ancestors 0f6b37dbe527 and 40663881a6dd
256 note: merging 3b08d01b0ab5+ and adfe50279922 using bids from ancestors 0f6b37dbe527 and 40663881a6dd
257
257
258 calculating bids for ancestor 0f6b37dbe527
258 calculating bids for ancestor 0f6b37dbe527
259 resolving manifests
259 resolving manifests
260 branchmerge: True, force: False, partial: False
260 branchmerge: True, force: False, partial: False
261 ancestor: 0f6b37dbe527, local: 3b08d01b0ab5+, remote: adfe50279922
261 ancestor: 0f6b37dbe527, local: 3b08d01b0ab5+, remote: adfe50279922
262 f1: remote is newer -> g
262 f1: remote is newer -> g
263 f2: versions differ -> m
263 f2: versions differ -> m
264
264
265 calculating bids for ancestor 40663881a6dd
265 calculating bids for ancestor 40663881a6dd
266 resolving manifests
266 resolving manifests
267 branchmerge: True, force: False, partial: False
267 branchmerge: True, force: False, partial: False
268 ancestor: 40663881a6dd, local: 3b08d01b0ab5+, remote: adfe50279922
268 ancestor: 40663881a6dd, local: 3b08d01b0ab5+, remote: adfe50279922
269 f1: versions differ -> m
269 f1: versions differ -> m
270 f2: remote unchanged -> k
270 f2: remote unchanged -> k
271
271
272 auction for merging merge bids (2 ancestors)
272 auction for merging merge bids (2 ancestors)
273 list of bids for f1:
273 list of bids for f1:
274 remote is newer -> g
274 remote is newer -> g
275 versions differ -> m
275 versions differ -> m
276 f1: picking 'get' action
276 f1: picking 'get' action
277 list of bids for f2:
277 list of bids for f2:
278 remote unchanged -> k
278 remote unchanged -> k
279 versions differ -> m
279 versions differ -> m
280 f2: picking 'keep' action
280 f2: picking 'keep' action
281 end of auction
281 end of auction
282
282
283 f1: remote is newer -> g
283 f1: remote is newer -> g
284 getting f1
284 getting f1
285 f2: remote unchanged -> k
285 f2: remote unchanged -> k
286 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
286 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
287 (branch merge, don't forget to commit)
287 (branch merge, don't forget to commit)
288
288
289 Test the greatest common ancestor returning multiple changesets
289 Test the greatest common ancestor returning multiple changesets
290
290
291 $ hg log -r 'heads(commonancestors(head()))'
291 $ hg log -r 'heads(commonancestors(head()))'
292 changeset: 1:0f6b37dbe527
292 changeset: 1:0f6b37dbe527
293 user: test
293 user: test
294 date: Thu Jan 01 00:00:00 1970 +0000
294 date: Thu Jan 01 00:00:00 1970 +0000
295 summary: 1 first change f1
295 summary: 1 first change f1
296
296
297 changeset: 2:40663881a6dd
297 changeset: 2:40663881a6dd
298 parent: 0:40494bf2444c
298 parent: 0:40494bf2444c
299 user: test
299 user: test
300 date: Thu Jan 01 00:00:00 1970 +0000
300 date: Thu Jan 01 00:00:00 1970 +0000
301 summary: 2 first change f2
301 summary: 2 first change f2
302
302
303
303
304 $ cd ..
304 $ cd ..
305
305
306 http://stackoverflow.com/questions/9350005/how-do-i-specify-a-merge-base-to-use-in-a-hg-merge/9430810
306 http://stackoverflow.com/questions/9350005/how-do-i-specify-a-merge-base-to-use-in-a-hg-merge/9430810
307
307
308 $ hg init ancestor-merging
308 $ hg init ancestor-merging
309 $ cd ancestor-merging
309 $ cd ancestor-merging
310 $ echo a > x
310 $ echo a > x
311 $ hg commit -A -m a x
311 $ hg commit -A -m a x
312 $ hg update -q 0
312 $ hg update -q 0
313 $ echo b >> x
313 $ echo b >> x
314 $ hg commit -m b
314 $ hg commit -m b
315 $ hg update -q 0
315 $ hg update -q 0
316 $ echo c >> x
316 $ echo c >> x
317 $ hg commit -qm c
317 $ hg commit -qm c
318 $ hg update -q 1
318 $ hg update -q 1
319 $ hg merge -q --tool internal:local 2
319 $ hg merge -q --tool internal:local 2
320 $ echo c >> x
320 $ echo c >> x
321 $ hg commit -m bc
321 $ hg commit -m bc
322 $ hg update -q 2
322 $ hg update -q 2
323 $ hg merge -q --tool internal:local 1
323 $ hg merge -q --tool internal:local 1
324 $ echo b >> x
324 $ echo b >> x
325 $ hg commit -qm cb
325 $ hg commit -qm cb
326
326
327 $ hg merge --config merge.preferancestor='!'
327 $ hg merge --config merge.preferancestor='!'
328 note: using 70008a2163f6 as ancestor of 0d355fdef312 and 4b8b546a3eef
328 note: using 70008a2163f6 as ancestor of 0d355fdef312 and 4b8b546a3eef
329 alternatively, use --config merge.preferancestor=b211bbc6eb3c
329 alternatively, use --config merge.preferancestor=b211bbc6eb3c
330 merging x
330 merging x
331 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
331 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
332 (branch merge, don't forget to commit)
332 (branch merge, don't forget to commit)
333 $ cat x
333 $ cat x
334 a
334 a
335 c
335 c
336 b
336 b
337 c
337 c
338
338
339 $ hg up -qC .
339 $ hg up -qC .
340
340
341 $ hg merge --config merge.preferancestor=b211bbc6eb3c
341 $ hg merge --config merge.preferancestor=b211bbc6eb3c
342 note: using b211bbc6eb3c as ancestor of 0d355fdef312 and 4b8b546a3eef
342 note: using b211bbc6eb3c as ancestor of 0d355fdef312 and 4b8b546a3eef
343 alternatively, use --config merge.preferancestor=70008a2163f6
343 alternatively, use --config merge.preferancestor=70008a2163f6
344 merging x
344 merging x
345 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
345 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
346 (branch merge, don't forget to commit)
346 (branch merge, don't forget to commit)
347 $ cat x
347 $ cat x
348 a
348 a
349 b
349 b
350 c
350 c
351 b
351 b
352
352
353 $ hg up -qC .
353 $ hg up -qC .
354
354
355 $ hg merge -v --config merge.preferancestor="*"
355 $ hg merge -v --config merge.preferancestor="*"
356 note: merging 0d355fdef312+ and 4b8b546a3eef using bids from ancestors 70008a2163f6 and b211bbc6eb3c
356 note: merging 0d355fdef312+ and 4b8b546a3eef using bids from ancestors 70008a2163f6 and b211bbc6eb3c
357
357
358 calculating bids for ancestor 70008a2163f6
358 calculating bids for ancestor 70008a2163f6
359 resolving manifests
359 resolving manifests
360
360
361 calculating bids for ancestor b211bbc6eb3c
361 calculating bids for ancestor b211bbc6eb3c
362 resolving manifests
362 resolving manifests
363
363
364 auction for merging merge bids (2 ancestors)
364 auction for merging merge bids (2 ancestors)
365 x: multiple bids for merge action:
365 x: multiple bids for merge action:
366 versions differ -> m
366 versions differ -> m
367 versions differ -> m
367 versions differ -> m
368 x: ambiguous merge - picked m action
368 x: ambiguous merge - picked m action
369 end of auction
369 end of auction
370
370
371 merging x
371 merging x
372 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
372 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
373 (branch merge, don't forget to commit)
373 (branch merge, don't forget to commit)
374 $ cat x
374 $ cat x
375 a
375 a
376 c
376 c
377 b
377 b
378 c
378 c
379
379
380 Verify that the old context ancestor works with / despite preferancestor:
380 Verify that the old context ancestor works with / despite preferancestor:
381
381
382 $ hg log -r 'ancestor(head())' --config merge.preferancestor=1 -T '{rev}\n'
382 $ hg log -r 'ancestor(head())' --config merge.preferancestor=1 -T '{rev}\n'
383 1
383 1
384 $ hg log -r 'ancestor(head())' --config merge.preferancestor=2 -T '{rev}\n'
384 $ hg log -r 'ancestor(head())' --config merge.preferancestor=2 -T '{rev}\n'
385 2
385 2
386 $ hg log -r 'ancestor(head())' --config merge.preferancestor=3 -T '{rev}\n'
386 $ hg log -r 'ancestor(head())' --config merge.preferancestor=3 -T '{rev}\n'
387 1
387 1
388 $ hg log -r 'ancestor(head())' --config merge.preferancestor='1337 * - 2' -T '{rev}\n'
388 $ hg log -r 'ancestor(head())' --config merge.preferancestor='1337 * - 2' -T '{rev}\n'
389 2
389 2
390
390
391 $ cd ..
391 $ cd ..
392
392
393 $ hg init issue5020
393 $ hg init issue5020
394 $ cd issue5020
394 $ cd issue5020
395
395
396 $ echo a > noop
396 $ echo a > noop
397 $ hg ci -qAm initial
397 $ hg ci -qAm initial
398
398
399 $ echo b > noop
399 $ echo b > noop
400 $ hg ci -qAm 'uninteresting change'
400 $ hg ci -qAm 'uninteresting change'
401
401
402 $ hg up -q 0
402 $ hg up -q 0
403 $ mkdir d1
403 $ mkdir d1
404 $ echo a > d1/a
404 $ echo a > d1/a
405 $ echo b > d1/b
405 $ echo b > d1/b
406 $ hg ci -qAm 'add d1/a and d1/b'
406 $ hg ci -qAm 'add d1/a and d1/b'
407
407
408 $ hg merge -q 1
408 $ hg merge -q 1
409 $ hg rm d1/a
409 $ hg rm d1/a
410 $ hg mv -q d1 d2
410 $ hg mv -q d1 d2
411 $ hg ci -qm 'merge while removing d1/a and moving d1/b to d2/b'
411 $ hg ci -qm 'merge while removing d1/a and moving d1/b to d2/b'
412
412
413 $ hg up -q 1
413 $ hg up -q 1
414 $ hg merge -q 2
414 $ hg merge -q 2
415 $ hg ci -qm 'merge (no changes while merging)'
415 $ hg ci -qm 'merge (no changes while merging)'
416 $ hg log -G -T '{rev}:{node|short} {desc}'
416 $ hg log -G -T '{rev}:{node|short} {desc}'
417 @ 4:c0ef19750a22 merge (no changes while merging)
417 @ 4:c0ef19750a22 merge (no changes while merging)
418 |\
418 |\
419 +---o 3:6ca01f7342b9 merge while removing d1/a and moving d1/b to d2/b
419 +---o 3:6ca01f7342b9 merge while removing d1/a and moving d1/b to d2/b
420 | |/
420 | |/
421 | o 2:154e6000f54e add d1/a and d1/b
421 | o 2:154e6000f54e add d1/a and d1/b
422 | |
422 | |
423 o | 1:11b5b303e36c uninteresting change
423 o | 1:11b5b303e36c uninteresting change
424 |/
424 |/
425 o 0:7b54db1ebf33 initial
425 o 0:7b54db1ebf33 initial
426
426
427 $ hg merge 3 --debug
427 $ hg merge 3 --debug
428 note: merging c0ef19750a22+ and 6ca01f7342b9 using bids from ancestors 11b5b303e36c and 154e6000f54e
428 note: merging c0ef19750a22+ and 6ca01f7342b9 using bids from ancestors 11b5b303e36c and 154e6000f54e
429
429
430 calculating bids for ancestor 11b5b303e36c
430 calculating bids for ancestor 11b5b303e36c
431 resolving manifests
431 resolving manifests
432 branchmerge: True, force: False, partial: False
432 branchmerge: True, force: False, partial: False
433 ancestor: 11b5b303e36c, local: c0ef19750a22+, remote: 6ca01f7342b9
433 ancestor: 11b5b303e36c, local: c0ef19750a22+, remote: 6ca01f7342b9
434 d2/b: remote created -> g
434 d2/b: remote created -> g
435
435
436 calculating bids for ancestor 154e6000f54e
436 calculating bids for ancestor 154e6000f54e
437 unmatched files in other:
437 unmatched files in other:
438 d2/b
438 d2/b
439 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
439 all copies found (* = to merge, ! = divergent, % = renamed and deleted):
440 on remote side:
440 on remote side:
441 src: 'd1/b' -> dst: 'd2/b'
441 src: 'd1/b' -> dst: 'd2/b'
442 checking for directory renames
442 checking for directory renames
443 discovered dir src: 'd1/' -> dst: 'd2/'
443 discovered dir src: 'd1/' -> dst: 'd2/'
444 resolving manifests
444 resolving manifests
445 branchmerge: True, force: False, partial: False
445 branchmerge: True, force: False, partial: False
446 ancestor: 154e6000f54e, local: c0ef19750a22+, remote: 6ca01f7342b9
446 ancestor: 154e6000f54e, local: c0ef19750a22+, remote: 6ca01f7342b9
447 d1/a: other deleted -> r
447 d1/a: other deleted -> r
448 d1/b: other deleted -> r
448 d1/b: other deleted -> r
449 d2/b: remote created -> g
449 d2/b: remote created -> g
450
450
451 auction for merging merge bids (2 ancestors)
451 auction for merging merge bids (2 ancestors)
452 list of bids for d1/a:
452 list of bids for d1/a:
453 other deleted -> r
453 other deleted -> r
454 d1/a: consensus for r
454 d1/a: consensus for r
455 list of bids for d1/b:
455 list of bids for d1/b:
456 other deleted -> r
456 other deleted -> r
457 d1/b: consensus for r
457 d1/b: consensus for r
458 list of bids for d2/b:
458 list of bids for d2/b:
459 remote created -> g
459 remote created -> g
460 remote created -> g
460 remote created -> g
461 d2/b: consensus for g
461 d2/b: consensus for g
462 end of auction
462 end of auction
463
463
464 d1/a: other deleted -> r
464 d1/a: other deleted -> r
465 removing d1/a
465 removing d1/a
466 d1/b: other deleted -> r
466 d1/b: other deleted -> r
467 removing d1/b
467 removing d1/b
468 d2/b: remote created -> g
468 d2/b: remote created -> g
469 getting d2/b
469 getting d2/b
470 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
470 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
471 (branch merge, don't forget to commit)
471 (branch merge, don't forget to commit)
472
473
474 Check that removal reversion does not go unotified
475 ==================================================
476
477 On a merge, a file can be removed and user can revert that removal. This means
478 user has made an explicit choice of keeping the file or reverting the removal
479 even though the merge algo wanted to remove it.
480 Based on this, when we do criss cross merges, merge algorithm should not again
481 choose to remove the file as in one of the merges, user made an explicit choice
482 to revert the removal.
483 Following test cases demonstrate how merge algo does not take in account
484 explicit choices made by users to revert the removal and on criss-cross merging
485 removes the file again.
486
487 "Simple" case where the filenode changes
488 ----------------------------------------
489
490 $ cd ..
491 $ hg init criss-cross-merge-reversal-with-update
492 $ cd criss-cross-merge-reversal-with-update
493 $ echo the-file > the-file
494 $ echo other-file > other-file
495 $ hg add the-file other-file
496 $ hg ci -m 'root-commit'
497 $ echo foo >> the-file
498 $ echo bar >> other-file
499 $ hg ci -m 'updating-both-file'
500 $ hg up 'desc("root-commit")'
501 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
502 $ hg rm the-file
503 $ hg ci -m 'delete-the-file'
504 created new head
505 $ hg log -G -T '{node|short} {desc}\n'
506 @ 7801bc9b9899 delete-the-file
507 |
508 | o 9b610631ab29 updating-both-file
509 |/
510 o 955800955977 root-commit
511
512
513 Do all the merge combination (from the deleted or the update side Γ— keeping and deleting the file
514
515 $ hg update 'desc("delete-the-file")'
516 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
517 $ hg merge 'desc("updating-both-file")' -t :local
518 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
519 (branch merge, don't forget to commit)
520 $ hg ci -m "merge-deleting-the-file-from-deleted"
521 $ hg manifest
522 other-file
523
524 $ hg update 'desc("updating-both-file")'
525 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
526 $ hg merge 'desc("delete-the-file")' -t :other
527 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
528 (branch merge, don't forget to commit)
529 $ hg ci -m "merge-deleting-the-file-from-updated"
530 created new head
531 $ hg manifest
532 other-file
533
534 $ hg update 'desc("delete-the-file")'
535 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
536 $ hg merge 'desc("updating-both-file")' -t :other
537 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
538 (branch merge, don't forget to commit)
539 $ hg ci -m "merge-keeping-the-file-from-deleted"
540 created new head
541 $ hg manifest
542 other-file
543 the-file
544
545 $ hg update 'desc("updating-both-file")'
546 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
547 $ hg merge 'desc("delete-the-file")' -t :local
548 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
549 (branch merge, don't forget to commit)
550 $ hg ci -m "merge-keeping-the-file-from-updated"
551 created new head
552 $ hg manifest
553 other-file
554 the-file
555
556 There the resulting merge together (leading to criss cross situation). Check
557 the conflict is properly detected.
558
559 (merging two deletion together β†’ no conflict)
560
561 $ hg update --clean 'desc("merge-deleting-the-file-from-deleted")'
562 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
563 $ hg merge 'desc("merge-deleting-the-file-from-updated")'
564 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
565 (branch merge, don't forget to commit)
566 $ ls -1
567 other-file
568
569 (merging a deletion with keeping β†’ conflict)
570 BROKEN: this should result in conflict
571
572 $ hg update --clean 'desc("merge-deleting-the-file-from-deleted")'
573 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
574 $ hg merge 'desc("merge-keeping-the-file-from-deleted")'
575 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
576 (branch merge, don't forget to commit)
577 $ ls -1
578 other-file
579 the-file
580
581 (merging a deletion with keeping β†’ conflict)
582 BROKEN: this should result in conflict
583
584 $ hg update --clean 'desc("merge-deleting-the-file-from-deleted")'
585 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
586 $ hg merge 'desc("merge-keeping-the-file-from-updated")'
587 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
588 (branch merge, don't forget to commit)
589 $ ls -1
590 other-file
591 the-file
592
593 (merging two deletion together β†’ no conflict)
594
595 $ hg update --clean 'desc("merge-deleting-the-file-from-updated")'
596 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
597 $ hg merge 'desc("merge-deleting-the-file-from-deleted")'
598 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
599 (branch merge, don't forget to commit)
600 $ ls -1
601 other-file
602
603 (merging a deletion with keeping β†’ conflict)
604 BROKEN: this should result in conflict
605
606 $ hg update --clean 'desc("merge-deleting-the-file-from-updated")'
607 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
608 $ hg merge 'desc("merge-keeping-the-file-from-deleted")'
609 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
610 (branch merge, don't forget to commit)
611 $ ls -1
612 other-file
613 the-file
614
615 (merging a deletion with keeping β†’ conflict)
616 BROKEN: this should result in conflict
617
618 $ hg update --clean 'desc("merge-deleting-the-file-from-updated")'
619 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
620 $ hg merge 'desc("merge-keeping-the-file-from-updated")'
621 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
622 (branch merge, don't forget to commit)
623 $ ls -1
624 other-file
625 the-file
626
627 (merging two "keeping" together β†’ no conflict)
628
629 $ hg update --clean 'desc("merge-keeping-the-file-from-updated")'
630 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
631 $ hg merge 'desc("merge-keeping-the-file-from-deleted")'
632 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
633 (branch merge, don't forget to commit)
634 $ ls -1
635 other-file
636 the-file
637
638 (merging a deletion with keeping β†’ conflict)
639 BROKEN: this should result in conflict
640
641 $ hg update --clean 'desc("merge-keeping-the-file-from-updated")'
642 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
643 $ hg merge 'desc("merge-deleted-the-file-from-deleted")'
644 abort: empty revision set
645 [255]
646 $ ls -1
647 other-file
648 the-file
649
650 (merging a deletion with keeping β†’ conflict)
651 BROKEN: this should result in conflict
652
653 $ hg update --clean 'desc("merge-keeping-the-file-from-updated")'
654 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
655 $ hg merge 'desc("merge-deleting-the-file-from-updated")'
656 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
657 (branch merge, don't forget to commit)
658 $ ls -1
659 other-file
660
661 (merging two "keeping" together β†’ no conflict)
662
663 $ hg update --clean 'desc("merge-keeping-the-file-from-deleted")'
664 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
665 $ hg merge 'desc("merge-keeping-the-file-from-updated")'
666 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
667 (branch merge, don't forget to commit)
668 $ ls -1
669 other-file
670 the-file
671
672 (merging a deletion with keeping β†’ conflict)
673 BROKEN: this should result in conflict
674
675 $ hg update --clean 'desc("merge-keeping-the-file-from-deleted")'
676 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
677 $ hg merge 'desc("merge-deleted-the-file-from-deleted")'
678 abort: empty revision set
679 [255]
680 $ ls -1
681 other-file
682 the-file
683
684 (merging a deletion with keeping β†’ conflict)
685 BROKEN: this should result in conflict
686
687 $ hg update --clean 'desc("merge-keeping-the-file-from-deleted")'
688 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
689 $ hg merge 'desc("merge-deleting-the-file-from-updated")'
690 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
691 (branch merge, don't forget to commit)
692 $ ls -1
693 other-file
General Comments 0
You need to be logged in to leave comments. Login now