Show More
@@ -1,747 +1,781 | |||||
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 | |||
|
535 | local (working copy): 7801bc9b9899de5e304bd162cafde9b78e10ab9b | |||
|
536 | other (merge rev): 9b610631ab29024c5f44af7d2c19658ef8f8f071 | |||
|
537 | file: the-file (state "r") | |||
|
538 | local path: the-file (hash 0000000000000000000000000000000000000000, flags "") | |||
|
539 | ancestor path: the-file (node 4b69178b9bdae28b651393b46e631427a72f217a) | |||
|
540 | other path: the-file (node 59e363a07dc876278f0e41756236f30213b6b460) | |||
|
541 | extra: ancestorlinknode = 955800955977bd6c103836ee3e437276e940a589 | |||
|
542 | extra: other-file (filenode-source = other) | |||
534 |
|
|
543 | $ hg ci -m "merge-deleting-the-file-from-deleted" | |
535 | $ hg manifest |
|
544 | $ hg manifest | |
536 | other-file |
|
545 | other-file | |
537 | $ hg debugrevlogindex the-file |
|
546 | $ hg debugrevlogindex the-file | |
538 | rev linkrev nodeid p1 p2 |
|
547 | rev linkrev nodeid p1 p2 | |
539 | 0 0 4b69178b9bda 000000000000 000000000000 |
|
548 | 0 0 4b69178b9bda 000000000000 000000000000 | |
540 | 1 1 59e363a07dc8 4b69178b9bda 000000000000 |
|
549 | 1 1 59e363a07dc8 4b69178b9bda 000000000000 | |
541 |
|
550 | |||
542 | $ hg update 'desc("updating-both-file")' |
|
551 | $ hg update 'desc("updating-both-file")' | |
543 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
552 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
544 | $ hg merge 'desc("delete-the-file")' -t :other |
|
553 | $ hg merge 'desc("delete-the-file")' -t :other | |
545 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
554 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
546 | (branch merge, don't forget to commit) |
|
555 | (branch merge, don't forget to commit) | |
|
556 | $ hg debugmergestate | |||
|
557 | local (working copy): 9b610631ab29024c5f44af7d2c19658ef8f8f071 | |||
|
558 | other (merge rev): 7801bc9b9899de5e304bd162cafde9b78e10ab9b | |||
|
559 | file: the-file (state "r") | |||
|
560 | local path: the-file (hash 6d2e02da5a9fe0691363dc6b573845fa271eaa35, flags "") | |||
|
561 | ancestor path: the-file (node 4b69178b9bdae28b651393b46e631427a72f217a) | |||
|
562 | other path: the-file (node 0000000000000000000000000000000000000000) | |||
|
563 | extra: ancestorlinknode = 955800955977bd6c103836ee3e437276e940a589 | |||
547 | $ hg ci -m "merge-deleting-the-file-from-updated" |
|
564 | $ hg ci -m "merge-deleting-the-file-from-updated" | |
548 | created new head |
|
565 | created new head | |
549 | $ hg manifest |
|
566 | $ hg manifest | |
550 | other-file |
|
567 | other-file | |
551 | $ hg debugrevlogindex the-file |
|
568 | $ hg debugrevlogindex the-file | |
552 | rev linkrev nodeid p1 p2 |
|
569 | rev linkrev nodeid p1 p2 | |
553 | 0 0 4b69178b9bda 000000000000 000000000000 |
|
570 | 0 0 4b69178b9bda 000000000000 000000000000 | |
554 | 1 1 59e363a07dc8 4b69178b9bda 000000000000 |
|
571 | 1 1 59e363a07dc8 4b69178b9bda 000000000000 | |
555 |
|
572 | |||
556 | $ hg update 'desc("delete-the-file")' |
|
573 | $ hg update 'desc("delete-the-file")' | |
557 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
574 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
558 | $ hg merge 'desc("updating-both-file")' -t :other |
|
575 | $ hg merge 'desc("updating-both-file")' -t :other | |
559 | 1 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
576 | 1 files updated, 1 files merged, 0 files removed, 0 files unresolved | |
560 | (branch merge, don't forget to commit) |
|
577 | (branch merge, don't forget to commit) | |
|
578 | $ hg debugmergestate | |||
|
579 | local (working copy): 7801bc9b9899de5e304bd162cafde9b78e10ab9b | |||
|
580 | other (merge rev): 9b610631ab29024c5f44af7d2c19658ef8f8f071 | |||
|
581 | file: the-file (state "r") | |||
|
582 | local path: the-file (hash 0000000000000000000000000000000000000000, flags "") | |||
|
583 | ancestor path: the-file (node 4b69178b9bdae28b651393b46e631427a72f217a) | |||
|
584 | other path: the-file (node 59e363a07dc876278f0e41756236f30213b6b460) | |||
|
585 | extra: ancestorlinknode = 955800955977bd6c103836ee3e437276e940a589 | |||
|
586 | extra: other-file (filenode-source = other) | |||
561 |
|
|
587 | $ hg ci -m "merge-keeping-the-file-from-deleted" | |
562 | created new head |
|
588 | created new head | |
563 | $ hg manifest |
|
589 | $ hg manifest | |
564 | other-file |
|
590 | other-file | |
565 | the-file |
|
591 | the-file | |
566 |
|
592 | |||
567 | XXX: This should create a new filenode because user explicitly decided to keep |
|
593 | XXX: This should create a new filenode because user explicitly decided to keep | |
568 | the file. If we reuse the same filenode, future merges (criss-cross ones mostly) |
|
594 | the file. If we reuse the same filenode, future merges (criss-cross ones mostly) | |
569 | will think that file remain unchanged and user explicit choice will not be taken |
|
595 | will think that file remain unchanged and user explicit choice will not be taken | |
570 | in consideration. |
|
596 | in consideration. | |
571 | $ hg debugrevlogindex the-file |
|
597 | $ hg debugrevlogindex the-file | |
572 | rev linkrev nodeid p1 p2 |
|
598 | rev linkrev nodeid p1 p2 | |
573 | 0 0 4b69178b9bda 000000000000 000000000000 |
|
599 | 0 0 4b69178b9bda 000000000000 000000000000 | |
574 | 1 1 59e363a07dc8 4b69178b9bda 000000000000 |
|
600 | 1 1 59e363a07dc8 4b69178b9bda 000000000000 | |
575 |
|
601 | |||
576 | $ hg update 'desc("updating-both-file")' |
|
602 | $ hg update 'desc("updating-both-file")' | |
577 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
603 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
578 | $ hg merge 'desc("delete-the-file")' -t :local |
|
604 | $ hg merge 'desc("delete-the-file")' -t :local | |
579 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
605 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved | |
580 | (branch merge, don't forget to commit) |
|
606 | (branch merge, don't forget to commit) | |
|
607 | $ hg debugmergestate | |||
|
608 | local (working copy): 9b610631ab29024c5f44af7d2c19658ef8f8f071 | |||
|
609 | other (merge rev): 7801bc9b9899de5e304bd162cafde9b78e10ab9b | |||
|
610 | file: the-file (state "r") | |||
|
611 | local path: the-file (hash 6d2e02da5a9fe0691363dc6b573845fa271eaa35, flags "") | |||
|
612 | ancestor path: the-file (node 4b69178b9bdae28b651393b46e631427a72f217a) | |||
|
613 | other path: the-file (node 0000000000000000000000000000000000000000) | |||
|
614 | extra: ancestorlinknode = 955800955977bd6c103836ee3e437276e940a589 | |||
581 | $ hg ci -m "merge-keeping-the-file-from-updated" |
|
615 | $ hg ci -m "merge-keeping-the-file-from-updated" | |
582 | created new head |
|
616 | created new head | |
583 | $ hg manifest |
|
617 | $ hg manifest | |
584 | other-file |
|
618 | other-file | |
585 | the-file |
|
619 | the-file | |
586 |
|
620 | |||
587 | XXX: This should create a new filenode because user explicitly decided to keep |
|
621 | XXX: This should create a new filenode because user explicitly decided to keep | |
588 | the file. If we reuse the same filenode, future merges (criss-cross ones mostly) |
|
622 | the file. If we reuse the same filenode, future merges (criss-cross ones mostly) | |
589 | will think that file remain unchanged and user explicit choice will not be taken |
|
623 | will think that file remain unchanged and user explicit choice will not be taken | |
590 | in consideration. |
|
624 | in consideration. | |
591 | $ hg debugrevlogindex the-file |
|
625 | $ hg debugrevlogindex the-file | |
592 | rev linkrev nodeid p1 p2 |
|
626 | rev linkrev nodeid p1 p2 | |
593 | 0 0 4b69178b9bda 000000000000 000000000000 |
|
627 | 0 0 4b69178b9bda 000000000000 000000000000 | |
594 | 1 1 59e363a07dc8 4b69178b9bda 000000000000 |
|
628 | 1 1 59e363a07dc8 4b69178b9bda 000000000000 | |
595 |
|
629 | |||
596 | $ hg log -G -T '{node|short} {desc}\n' |
|
630 | $ hg log -G -T '{node|short} {desc}\n' | |
597 | @ 5e3eccec60d8 merge-keeping-the-file-from-updated |
|
631 | @ 5e3eccec60d8 merge-keeping-the-file-from-updated | |
598 | |\ |
|
632 | |\ | |
599 | +---o e9b708131723 merge-keeping-the-file-from-deleted |
|
633 | +---o e9b708131723 merge-keeping-the-file-from-deleted | |
600 | | |/ |
|
634 | | |/ | |
601 | +---o a4e0e44229dc merge-deleting-the-file-from-updated |
|
635 | +---o a4e0e44229dc merge-deleting-the-file-from-updated | |
602 | | |/ |
|
636 | | |/ | |
603 | +---o adfd88e5d7d3 merge-deleting-the-file-from-deleted |
|
637 | +---o adfd88e5d7d3 merge-deleting-the-file-from-deleted | |
604 | | |/ |
|
638 | | |/ | |
605 | | o 7801bc9b9899 delete-the-file |
|
639 | | o 7801bc9b9899 delete-the-file | |
606 | | | |
|
640 | | | | |
607 | o | 9b610631ab29 updating-both-file |
|
641 | o | 9b610631ab29 updating-both-file | |
608 | |/ |
|
642 | |/ | |
609 | o 955800955977 root-commit |
|
643 | o 955800955977 root-commit | |
610 |
|
644 | |||
611 |
|
645 | |||
612 | There the resulting merge together (leading to criss cross situation). Check |
|
646 | There the resulting merge together (leading to criss cross situation). Check | |
613 | the conflict is properly detected. |
|
647 | the conflict is properly detected. | |
614 |
|
648 | |||
615 | (merging two deletion together → no conflict) |
|
649 | (merging two deletion together → no conflict) | |
616 |
|
650 | |||
617 | $ hg update --clean 'desc("merge-deleting-the-file-from-deleted")' |
|
651 | $ hg update --clean 'desc("merge-deleting-the-file-from-deleted")' | |
618 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
652 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
619 | $ hg merge 'desc("merge-deleting-the-file-from-updated")' |
|
653 | $ hg merge 'desc("merge-deleting-the-file-from-updated")' | |
620 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
654 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
621 | (branch merge, don't forget to commit) |
|
655 | (branch merge, don't forget to commit) | |
622 | $ ls -1 |
|
656 | $ ls -1 | |
623 | other-file |
|
657 | other-file | |
624 |
|
658 | |||
625 | (merging a deletion with keeping → conflict) |
|
659 | (merging a deletion with keeping → conflict) | |
626 | BROKEN: this should result in conflict |
|
660 | BROKEN: this should result in conflict | |
627 |
|
661 | |||
628 | $ hg update --clean 'desc("merge-deleting-the-file-from-deleted")' |
|
662 | $ hg update --clean 'desc("merge-deleting-the-file-from-deleted")' | |
629 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
663 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
630 | $ hg merge 'desc("merge-keeping-the-file-from-deleted")' |
|
664 | $ hg merge 'desc("merge-keeping-the-file-from-deleted")' | |
631 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
665 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
632 | (branch merge, don't forget to commit) |
|
666 | (branch merge, don't forget to commit) | |
633 | $ ls -1 |
|
667 | $ ls -1 | |
634 | other-file |
|
668 | other-file | |
635 |
|
669 | |||
636 | (merging a deletion with keeping → conflict) |
|
670 | (merging a deletion with keeping → conflict) | |
637 | BROKEN: this should result in conflict |
|
671 | BROKEN: this should result in conflict | |
638 |
|
672 | |||
639 | $ hg update --clean 'desc("merge-deleting-the-file-from-deleted")' |
|
673 | $ hg update --clean 'desc("merge-deleting-the-file-from-deleted")' | |
640 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
674 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
641 | $ hg merge 'desc("merge-keeping-the-file-from-updated")' |
|
675 | $ hg merge 'desc("merge-keeping-the-file-from-updated")' | |
642 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
676 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
643 | (branch merge, don't forget to commit) |
|
677 | (branch merge, don't forget to commit) | |
644 | $ ls -1 |
|
678 | $ ls -1 | |
645 | other-file |
|
679 | other-file | |
646 |
|
680 | |||
647 | (merging two deletion together → no conflict) |
|
681 | (merging two deletion together → no conflict) | |
648 |
|
682 | |||
649 | $ hg update --clean 'desc("merge-deleting-the-file-from-updated")' |
|
683 | $ hg update --clean 'desc("merge-deleting-the-file-from-updated")' | |
650 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
684 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
651 | $ hg merge 'desc("merge-deleting-the-file-from-deleted")' |
|
685 | $ hg merge 'desc("merge-deleting-the-file-from-deleted")' | |
652 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
686 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
653 | (branch merge, don't forget to commit) |
|
687 | (branch merge, don't forget to commit) | |
654 | $ ls -1 |
|
688 | $ ls -1 | |
655 | other-file |
|
689 | other-file | |
656 |
|
690 | |||
657 | (merging a deletion with keeping → conflict) |
|
691 | (merging a deletion with keeping → conflict) | |
658 | BROKEN: this should result in conflict |
|
692 | BROKEN: this should result in conflict | |
659 |
|
693 | |||
660 | $ hg update --clean 'desc("merge-deleting-the-file-from-updated")' |
|
694 | $ hg update --clean 'desc("merge-deleting-the-file-from-updated")' | |
661 | 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 | |
662 | $ hg merge 'desc("merge-keeping-the-file-from-deleted")' |
|
696 | $ hg merge 'desc("merge-keeping-the-file-from-deleted")' | |
663 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
697 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
664 | (branch merge, don't forget to commit) |
|
698 | (branch merge, don't forget to commit) | |
665 | $ ls -1 |
|
699 | $ ls -1 | |
666 | other-file |
|
700 | other-file | |
667 |
|
701 | |||
668 | (merging a deletion with keeping → conflict) |
|
702 | (merging a deletion with keeping → conflict) | |
669 | BROKEN: this should result in conflict |
|
703 | BROKEN: this should result in conflict | |
670 |
|
704 | |||
671 | $ hg update --clean 'desc("merge-deleting-the-file-from-updated")' |
|
705 | $ hg update --clean 'desc("merge-deleting-the-file-from-updated")' | |
672 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
706 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
673 | $ hg merge 'desc("merge-keeping-the-file-from-updated")' |
|
707 | $ hg merge 'desc("merge-keeping-the-file-from-updated")' | |
674 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
708 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
675 | (branch merge, don't forget to commit) |
|
709 | (branch merge, don't forget to commit) | |
676 | $ ls -1 |
|
710 | $ ls -1 | |
677 | other-file |
|
711 | other-file | |
678 |
|
712 | |||
679 | (merging two "keeping" together → no conflict) |
|
713 | (merging two "keeping" together → no conflict) | |
680 |
|
714 | |||
681 | $ hg update --clean 'desc("merge-keeping-the-file-from-updated")' |
|
715 | $ hg update --clean 'desc("merge-keeping-the-file-from-updated")' | |
682 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
716 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
683 | $ hg merge 'desc("merge-keeping-the-file-from-deleted")' |
|
717 | $ hg merge 'desc("merge-keeping-the-file-from-deleted")' | |
684 | 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 | |
685 | (branch merge, don't forget to commit) |
|
719 | (branch merge, don't forget to commit) | |
686 | $ ls -1 |
|
720 | $ ls -1 | |
687 | other-file |
|
721 | other-file | |
688 | the-file |
|
722 | the-file | |
689 |
|
723 | |||
690 | (merging a deletion with keeping → conflict) |
|
724 | (merging a deletion with keeping → conflict) | |
691 | BROKEN: this should result in conflict |
|
725 | BROKEN: this should result in conflict | |
692 |
|
726 | |||
693 | $ hg update --clean 'desc("merge-keeping-the-file-from-updated")' |
|
727 | $ hg update --clean 'desc("merge-keeping-the-file-from-updated")' | |
694 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
728 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
695 | $ hg merge 'desc("merge-deleted-the-file-from-deleted")' |
|
729 | $ hg merge 'desc("merge-deleted-the-file-from-deleted")' | |
696 | abort: empty revision set |
|
730 | abort: empty revision set | |
697 | [255] |
|
731 | [255] | |
698 | $ ls -1 |
|
732 | $ ls -1 | |
699 | other-file |
|
733 | other-file | |
700 | the-file |
|
734 | the-file | |
701 |
|
735 | |||
702 | (merging a deletion with keeping → conflict) |
|
736 | (merging a deletion with keeping → conflict) | |
703 | BROKEN: this should result in conflict |
|
737 | BROKEN: this should result in conflict | |
704 |
|
738 | |||
705 | $ hg update --clean 'desc("merge-keeping-the-file-from-updated")' |
|
739 | $ hg update --clean 'desc("merge-keeping-the-file-from-updated")' | |
706 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
740 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
707 | $ hg merge 'desc("merge-deleting-the-file-from-updated")' |
|
741 | $ hg merge 'desc("merge-deleting-the-file-from-updated")' | |
708 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
742 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
709 | (branch merge, don't forget to commit) |
|
743 | (branch merge, don't forget to commit) | |
710 | $ ls -1 |
|
744 | $ ls -1 | |
711 | other-file |
|
745 | other-file | |
712 | the-file |
|
746 | the-file | |
713 |
|
747 | |||
714 | (merging two "keeping" together → no conflict) |
|
748 | (merging two "keeping" together → no conflict) | |
715 |
|
749 | |||
716 | $ hg update --clean 'desc("merge-keeping-the-file-from-deleted")' |
|
750 | $ hg update --clean 'desc("merge-keeping-the-file-from-deleted")' | |
717 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
751 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
718 | $ hg merge 'desc("merge-keeping-the-file-from-updated")' |
|
752 | $ hg merge 'desc("merge-keeping-the-file-from-updated")' | |
719 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
753 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
720 | (branch merge, don't forget to commit) |
|
754 | (branch merge, don't forget to commit) | |
721 | $ ls -1 |
|
755 | $ ls -1 | |
722 | other-file |
|
756 | other-file | |
723 | the-file |
|
757 | the-file | |
724 |
|
758 | |||
725 | (merging a deletion with keeping → conflict) |
|
759 | (merging a deletion with keeping → conflict) | |
726 | BROKEN: this should result in conflict |
|
760 | BROKEN: this should result in conflict | |
727 |
|
761 | |||
728 | $ hg update --clean 'desc("merge-keeping-the-file-from-deleted")' |
|
762 | $ hg update --clean 'desc("merge-keeping-the-file-from-deleted")' | |
729 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
763 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
730 | $ hg merge 'desc("merge-deleted-the-file-from-deleted")' |
|
764 | $ hg merge 'desc("merge-deleted-the-file-from-deleted")' | |
731 | abort: empty revision set |
|
765 | abort: empty revision set | |
732 | [255] |
|
766 | [255] | |
733 | $ ls -1 |
|
767 | $ ls -1 | |
734 | other-file |
|
768 | other-file | |
735 | the-file |
|
769 | the-file | |
736 |
|
770 | |||
737 | (merging a deletion with keeping → conflict) |
|
771 | (merging a deletion with keeping → conflict) | |
738 | BROKEN: this should result in conflict |
|
772 | BROKEN: this should result in conflict | |
739 |
|
773 | |||
740 | $ hg update --clean 'desc("merge-keeping-the-file-from-deleted")' |
|
774 | $ hg update --clean 'desc("merge-keeping-the-file-from-deleted")' | |
741 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
775 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
742 | $ hg merge 'desc("merge-deleting-the-file-from-updated")' |
|
776 | $ hg merge 'desc("merge-deleting-the-file-from-updated")' | |
743 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
777 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
744 | (branch merge, don't forget to commit) |
|
778 | (branch merge, don't forget to commit) | |
745 | $ ls -1 |
|
779 | $ ls -1 | |
746 | other-file |
|
780 | other-file | |
747 | the-file |
|
781 | the-file |
General Comments 0
You need to be logged in to leave comments.
Login now