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