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