Show More
@@ -1,978 +1,1159 b'' | |||||
1 | #testcases filelog compatibility sidedata |
|
1 | #testcases filelog compatibility sidedata | |
2 |
|
2 | |||
3 | ===================================================== |
|
3 | ===================================================== | |
4 | Test Copy tracing for chain of copies involving merge |
|
4 | Test Copy tracing for chain of copies involving merge | |
5 | ===================================================== |
|
5 | ===================================================== | |
6 |
|
6 | |||
7 | This test files covers copies/rename case for a chains of commit where merges |
|
7 | This test files covers copies/rename case for a chains of commit where merges | |
8 | are involved. It cheks we do not have unwanted update of behavior and that the |
|
8 | are involved. It cheks we do not have unwanted update of behavior and that the | |
9 | different options to retrieve copies behave correctly. |
|
9 | different options to retrieve copies behave correctly. | |
10 |
|
10 | |||
11 |
|
11 | |||
12 | Setup |
|
12 | Setup | |
13 | ===== |
|
13 | ===== | |
14 |
|
14 | |||
15 | use git diff to see rename |
|
15 | use git diff to see rename | |
16 |
|
16 | |||
17 | $ cat << EOF >> $HGRCPATH |
|
17 | $ cat << EOF >> $HGRCPATH | |
18 | > [diff] |
|
18 | > [diff] | |
19 | > git=yes |
|
19 | > git=yes | |
20 | > [ui] |
|
20 | > [ui] | |
21 | > logtemplate={rev} {desc}\n |
|
21 | > logtemplate={rev} {desc}\n | |
22 | > EOF |
|
22 | > EOF | |
23 |
|
23 | |||
24 | #if compatibility |
|
24 | #if compatibility | |
25 | $ cat >> $HGRCPATH << EOF |
|
25 | $ cat >> $HGRCPATH << EOF | |
26 | > [experimental] |
|
26 | > [experimental] | |
27 | > copies.read-from = compatibility |
|
27 | > copies.read-from = compatibility | |
28 | > EOF |
|
28 | > EOF | |
29 | #endif |
|
29 | #endif | |
30 |
|
30 | |||
31 | #if sidedata |
|
31 | #if sidedata | |
32 | $ cat >> $HGRCPATH << EOF |
|
32 | $ cat >> $HGRCPATH << EOF | |
33 | > [format] |
|
33 | > [format] | |
34 | > exp-use-side-data = yes |
|
34 | > exp-use-side-data = yes | |
35 | > exp-use-copies-side-data-changeset = yes |
|
35 | > exp-use-copies-side-data-changeset = yes | |
36 | > EOF |
|
36 | > EOF | |
37 | #endif |
|
37 | #endif | |
38 |
|
38 | |||
39 |
|
39 | |||
40 | $ hg init repo-chain |
|
40 | $ hg init repo-chain | |
41 | $ cd repo-chain |
|
41 | $ cd repo-chain | |
42 |
|
42 | |||
43 | Add some linear rename initialy |
|
43 | Add some linear rename initialy | |
44 |
|
44 | |||
45 | $ touch a b h |
|
45 | $ touch a b h | |
46 | $ hg ci -Am 'i-0 initial commit: a b h' |
|
46 | $ hg ci -Am 'i-0 initial commit: a b h' | |
47 | adding a |
|
47 | adding a | |
48 | adding b |
|
48 | adding b | |
49 | adding h |
|
49 | adding h | |
50 | $ hg mv a c |
|
50 | $ hg mv a c | |
51 | $ hg ci -Am 'i-1: a -move-> c' |
|
51 | $ hg ci -Am 'i-1: a -move-> c' | |
52 | $ hg mv c d |
|
52 | $ hg mv c d | |
53 | $ hg ci -Am 'i-2: c -move-> d' |
|
53 | $ hg ci -Am 'i-2: c -move-> d' | |
54 | $ hg log -G |
|
54 | $ hg log -G | |
55 | @ 2 i-2: c -move-> d |
|
55 | @ 2 i-2: c -move-> d | |
56 | | |
|
56 | | | |
57 | o 1 i-1: a -move-> c |
|
57 | o 1 i-1: a -move-> c | |
58 | | |
|
58 | | | |
59 | o 0 i-0 initial commit: a b h |
|
59 | o 0 i-0 initial commit: a b h | |
60 |
|
60 | |||
61 |
|
61 | |||
62 | And having another branch with renames on the other side |
|
62 | And having another branch with renames on the other side | |
63 |
|
63 | |||
64 | $ hg mv d e |
|
64 | $ hg mv d e | |
65 | $ hg ci -Am 'a-1: d -move-> e' |
|
65 | $ hg ci -Am 'a-1: d -move-> e' | |
66 | $ hg mv e f |
|
66 | $ hg mv e f | |
67 | $ hg ci -Am 'a-2: e -move-> f' |
|
67 | $ hg ci -Am 'a-2: e -move-> f' | |
68 | $ hg log -G --rev '::.' |
|
68 | $ hg log -G --rev '::.' | |
69 | @ 4 a-2: e -move-> f |
|
69 | @ 4 a-2: e -move-> f | |
70 | | |
|
70 | | | |
71 | o 3 a-1: d -move-> e |
|
71 | o 3 a-1: d -move-> e | |
72 | | |
|
72 | | | |
73 | o 2 i-2: c -move-> d |
|
73 | o 2 i-2: c -move-> d | |
74 | | |
|
74 | | | |
75 | o 1 i-1: a -move-> c |
|
75 | o 1 i-1: a -move-> c | |
76 | | |
|
76 | | | |
77 | o 0 i-0 initial commit: a b h |
|
77 | o 0 i-0 initial commit: a b h | |
78 |
|
78 | |||
79 |
|
79 | |||
80 | Have a branching with nothing on one side |
|
80 | Have a branching with nothing on one side | |
81 |
|
81 | |||
82 | $ hg up 'desc("i-2")' |
|
82 | $ hg up 'desc("i-2")' | |
83 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
83 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
84 | $ echo foo > b |
|
84 | $ echo foo > b | |
85 | $ hg ci -m 'b-1: b update' |
|
85 | $ hg ci -m 'b-1: b update' | |
86 | created new head |
|
86 | created new head | |
87 | $ hg log -G --rev '::.' |
|
87 | $ hg log -G --rev '::.' | |
88 | @ 5 b-1: b update |
|
88 | @ 5 b-1: b update | |
89 | | |
|
89 | | | |
90 | o 2 i-2: c -move-> d |
|
90 | o 2 i-2: c -move-> d | |
91 | | |
|
91 | | | |
92 | o 1 i-1: a -move-> c |
|
92 | o 1 i-1: a -move-> c | |
93 | | |
|
93 | | | |
94 | o 0 i-0 initial commit: a b h |
|
94 | o 0 i-0 initial commit: a b h | |
95 |
|
95 | |||
96 |
|
96 | |||
97 | Create a branch that delete a file previous renamed |
|
97 | Create a branch that delete a file previous renamed | |
98 |
|
98 | |||
99 | $ hg up 'desc("i-2")' |
|
99 | $ hg up 'desc("i-2")' | |
100 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
100 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
101 | $ hg rm d |
|
101 | $ hg rm d | |
102 | $ hg ci -m 'c-1 delete d' |
|
102 | $ hg ci -m 'c-1 delete d' | |
103 | created new head |
|
103 | created new head | |
104 | $ hg log -G --rev '::.' |
|
104 | $ hg log -G --rev '::.' | |
105 | @ 6 c-1 delete d |
|
105 | @ 6 c-1 delete d | |
106 | | |
|
106 | | | |
107 | o 2 i-2: c -move-> d |
|
107 | o 2 i-2: c -move-> d | |
108 | | |
|
108 | | | |
109 | o 1 i-1: a -move-> c |
|
109 | o 1 i-1: a -move-> c | |
110 | | |
|
110 | | | |
111 | o 0 i-0 initial commit: a b h |
|
111 | o 0 i-0 initial commit: a b h | |
112 |
|
112 | |||
113 |
|
113 | |||
114 | Create a branch that delete a file previous renamed and recreate it |
|
114 | Create a branch that delete a file previous renamed and recreate it | |
115 |
|
115 | |||
116 | $ hg up 'desc("i-2")' |
|
116 | $ hg up 'desc("i-2")' | |
117 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
117 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
118 | $ hg rm d |
|
118 | $ hg rm d | |
119 | $ hg ci -m 'd-1 delete d' |
|
119 | $ hg ci -m 'd-1 delete d' | |
120 | created new head |
|
120 | created new head | |
121 | $ echo bar > d |
|
121 | $ echo bar > d | |
122 | $ hg add d |
|
122 | $ hg add d | |
123 | $ hg ci -m 'd-2 re-add d' |
|
123 | $ hg ci -m 'd-2 re-add d' | |
124 | $ hg log -G --rev '::.' |
|
124 | $ hg log -G --rev '::.' | |
125 | @ 8 d-2 re-add d |
|
125 | @ 8 d-2 re-add d | |
126 | | |
|
126 | | | |
127 | o 7 d-1 delete d |
|
127 | o 7 d-1 delete d | |
128 | | |
|
128 | | | |
129 | o 2 i-2: c -move-> d |
|
129 | o 2 i-2: c -move-> d | |
130 | | |
|
130 | | | |
131 | o 1 i-1: a -move-> c |
|
131 | o 1 i-1: a -move-> c | |
132 | | |
|
132 | | | |
133 | o 0 i-0 initial commit: a b h |
|
133 | o 0 i-0 initial commit: a b h | |
134 |
|
134 | |||
135 |
|
135 | |||
136 | Having another branch renaming a different file to the same filename as another |
|
136 | Having another branch renaming a different file to the same filename as another | |
137 |
|
137 | |||
138 | $ hg up 'desc("i-2")' |
|
138 | $ hg up 'desc("i-2")' | |
139 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
139 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
140 | $ hg mv b g |
|
140 | $ hg mv b g | |
141 | $ hg ci -m 'e-1 b -move-> g' |
|
141 | $ hg ci -m 'e-1 b -move-> g' | |
142 | created new head |
|
142 | created new head | |
143 | $ hg mv g f |
|
143 | $ hg mv g f | |
144 | $ hg ci -m 'e-2 g -move-> f' |
|
144 | $ hg ci -m 'e-2 g -move-> f' | |
145 | $ hg log -G --rev '::.' |
|
145 | $ hg log -G --rev '::.' | |
146 | @ 10 e-2 g -move-> f |
|
146 | @ 10 e-2 g -move-> f | |
147 | | |
|
147 | | | |
148 | o 9 e-1 b -move-> g |
|
148 | o 9 e-1 b -move-> g | |
149 | | |
|
149 | | | |
150 | o 2 i-2: c -move-> d |
|
150 | o 2 i-2: c -move-> d | |
151 | | |
|
151 | | | |
152 | o 1 i-1: a -move-> c |
|
152 | o 1 i-1: a -move-> c | |
153 | | |
|
153 | | | |
154 | o 0 i-0 initial commit: a b h |
|
154 | o 0 i-0 initial commit: a b h | |
155 |
|
155 | |||
156 |
|
156 | |||
157 | merging with unrelated change does not interfere with the renames |
|
157 | merging with unrelated change does not interfere with the renames | |
158 | --------------------------------------------------------------- |
|
158 | --------------------------------------------------------------- | |
159 |
|
159 | |||
160 | - rename on one side |
|
160 | - rename on one side | |
161 | - unrelated change on the other side |
|
161 | - unrelated change on the other side | |
162 |
|
162 | |||
163 | $ hg up 'desc("b-1")' |
|
163 | $ hg up 'desc("b-1")' | |
164 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
164 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
165 | $ hg merge 'desc("a-2")' |
|
165 | $ hg merge 'desc("a-2")' | |
166 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
166 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
167 | (branch merge, don't forget to commit) |
|
167 | (branch merge, don't forget to commit) | |
168 | $ hg ci -m 'mBAm-0 simple merge - one way' |
|
168 | $ hg ci -m 'mBAm-0 simple merge - one way' | |
169 | $ hg up 'desc("a-2")' |
|
169 | $ hg up 'desc("a-2")' | |
170 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
170 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
171 | $ hg merge 'desc("b-1")' |
|
171 | $ hg merge 'desc("b-1")' | |
172 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
172 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
173 | (branch merge, don't forget to commit) |
|
173 | (branch merge, don't forget to commit) | |
174 | $ hg ci -m 'mABm-0 simple merge - the other way' |
|
174 | $ hg ci -m 'mABm-0 simple merge - the other way' | |
175 | created new head |
|
175 | created new head | |
176 | $ hg log -G --rev '::(desc("mABm")+desc("mBAm"))' |
|
176 | $ hg log -G --rev '::(desc("mABm")+desc("mBAm"))' | |
177 | @ 12 mABm-0 simple merge - the other way |
|
177 | @ 12 mABm-0 simple merge - the other way | |
178 | |\ |
|
178 | |\ | |
179 | +---o 11 mBAm-0 simple merge - one way |
|
179 | +---o 11 mBAm-0 simple merge - one way | |
180 | | |/ |
|
180 | | |/ | |
181 | | o 5 b-1: b update |
|
181 | | o 5 b-1: b update | |
182 | | | |
|
182 | | | | |
183 | o | 4 a-2: e -move-> f |
|
183 | o | 4 a-2: e -move-> f | |
184 | | | |
|
184 | | | | |
185 | o | 3 a-1: d -move-> e |
|
185 | o | 3 a-1: d -move-> e | |
186 | |/ |
|
186 | |/ | |
187 | o 2 i-2: c -move-> d |
|
187 | o 2 i-2: c -move-> d | |
188 | | |
|
188 | | | |
189 | o 1 i-1: a -move-> c |
|
189 | o 1 i-1: a -move-> c | |
190 | | |
|
190 | | | |
191 | o 0 i-0 initial commit: a b h |
|
191 | o 0 i-0 initial commit: a b h | |
192 |
|
192 | |||
193 |
|
193 | |||
194 | $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mABm")' |
|
194 | $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mABm")' | |
195 | A f |
|
195 | A f | |
196 | d |
|
196 | d | |
197 | R d |
|
197 | R d | |
198 | $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mBAm")' |
|
198 | $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mBAm")' | |
199 | A f |
|
199 | A f | |
200 | d |
|
200 | d | |
201 | R d |
|
201 | R d | |
202 | $ hg status --copies --rev 'desc("a-2")' --rev 'desc("mABm")' |
|
202 | $ hg status --copies --rev 'desc("a-2")' --rev 'desc("mABm")' | |
203 | M b |
|
203 | M b | |
204 | $ hg status --copies --rev 'desc("a-2")' --rev 'desc("mBAm")' |
|
204 | $ hg status --copies --rev 'desc("a-2")' --rev 'desc("mBAm")' | |
205 | M b |
|
205 | M b | |
206 | $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mABm")' |
|
206 | $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mABm")' | |
207 | M b |
|
207 | M b | |
208 | A f |
|
208 | A f | |
209 | d |
|
209 | d | |
210 | R d |
|
210 | R d | |
211 | $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mBAm")' |
|
211 | $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mBAm")' | |
212 | M b |
|
212 | M b | |
213 | A f |
|
213 | A f | |
214 | d |
|
214 | d | |
215 | R d |
|
215 | R d | |
216 | $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mABm")' |
|
216 | $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mABm")' | |
217 | M b |
|
217 | M b | |
218 | A f |
|
218 | A f | |
219 | a |
|
219 | a | |
220 | R a |
|
220 | R a | |
221 | $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBAm")' |
|
221 | $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBAm")' | |
222 | M b |
|
222 | M b | |
223 | A f |
|
223 | A f | |
224 | a |
|
224 | a | |
225 | R a |
|
225 | R a | |
226 |
|
226 | |||
227 | merging with the side having a delete |
|
227 | merging with the side having a delete | |
228 | ------------------------------------- |
|
228 | ------------------------------------- | |
229 |
|
229 | |||
230 | case summary: |
|
230 | case summary: | |
231 | - one with change to an unrelated file |
|
231 | - one with change to an unrelated file | |
232 | - one deleting the change |
|
232 | - one deleting the change | |
233 | and recreate an unrelated file after the merge |
|
233 | and recreate an unrelated file after the merge | |
234 |
|
234 | |||
235 | $ hg up 'desc("b-1")' |
|
235 | $ hg up 'desc("b-1")' | |
236 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
236 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
237 | $ hg merge 'desc("c-1")' |
|
237 | $ hg merge 'desc("c-1")' | |
238 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
238 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
239 | (branch merge, don't forget to commit) |
|
239 | (branch merge, don't forget to commit) | |
240 | $ hg ci -m 'mBCm-0 simple merge - one way' |
|
240 | $ hg ci -m 'mBCm-0 simple merge - one way' | |
241 | $ echo bar > d |
|
241 | $ echo bar > d | |
242 | $ hg add d |
|
242 | $ hg add d | |
243 | $ hg ci -m 'mBCm-1 re-add d' |
|
243 | $ hg ci -m 'mBCm-1 re-add d' | |
244 | $ hg up 'desc("c-1")' |
|
244 | $ hg up 'desc("c-1")' | |
245 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
245 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
246 | $ hg merge 'desc("b-1")' |
|
246 | $ hg merge 'desc("b-1")' | |
247 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
247 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
248 | (branch merge, don't forget to commit) |
|
248 | (branch merge, don't forget to commit) | |
249 | $ hg ci -m 'mCBm-0 simple merge - the other way' |
|
249 | $ hg ci -m 'mCBm-0 simple merge - the other way' | |
250 | created new head |
|
250 | created new head | |
251 | $ echo bar > d |
|
251 | $ echo bar > d | |
252 | $ hg add d |
|
252 | $ hg add d | |
253 | $ hg ci -m 'mCBm-1 re-add d' |
|
253 | $ hg ci -m 'mCBm-1 re-add d' | |
254 | $ hg log -G --rev '::(desc("mCBm")+desc("mBCm"))' |
|
254 | $ hg log -G --rev '::(desc("mCBm")+desc("mBCm"))' | |
255 | @ 16 mCBm-1 re-add d |
|
255 | @ 16 mCBm-1 re-add d | |
256 | | |
|
256 | | | |
257 | o 15 mCBm-0 simple merge - the other way |
|
257 | o 15 mCBm-0 simple merge - the other way | |
258 | |\ |
|
258 | |\ | |
259 | | | o 14 mBCm-1 re-add d |
|
259 | | | o 14 mBCm-1 re-add d | |
260 | | | | |
|
260 | | | | | |
261 | +---o 13 mBCm-0 simple merge - one way |
|
261 | +---o 13 mBCm-0 simple merge - one way | |
262 | | |/ |
|
262 | | |/ | |
263 | | o 6 c-1 delete d |
|
263 | | o 6 c-1 delete d | |
264 | | | |
|
264 | | | | |
265 | o | 5 b-1: b update |
|
265 | o | 5 b-1: b update | |
266 | |/ |
|
266 | |/ | |
267 | o 2 i-2: c -move-> d |
|
267 | o 2 i-2: c -move-> d | |
268 | | |
|
268 | | | |
269 | o 1 i-1: a -move-> c |
|
269 | o 1 i-1: a -move-> c | |
270 | | |
|
270 | | | |
271 | o 0 i-0 initial commit: a b h |
|
271 | o 0 i-0 initial commit: a b h | |
272 |
|
272 | |||
273 | - comparing from the merge |
|
273 | - comparing from the merge | |
274 |
|
274 | |||
275 | $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mBCm-0")' |
|
275 | $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mBCm-0")' | |
276 | R d |
|
276 | R d | |
277 | $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mCBm-0")' |
|
277 | $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mCBm-0")' | |
278 | R d |
|
278 | R d | |
279 | $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mBCm-0")' |
|
279 | $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mBCm-0")' | |
280 | M b |
|
280 | M b | |
281 | $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mCBm-0")' |
|
281 | $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mCBm-0")' | |
282 | M b |
|
282 | M b | |
283 | $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mBCm-0")' |
|
283 | $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mBCm-0")' | |
284 | M b |
|
284 | M b | |
285 | R d |
|
285 | R d | |
286 | $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mCBm-0")' |
|
286 | $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mCBm-0")' | |
287 | M b |
|
287 | M b | |
288 | R d |
|
288 | R d | |
289 | $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBCm-0")' |
|
289 | $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBCm-0")' | |
290 | M b |
|
290 | M b | |
291 | R a |
|
291 | R a | |
292 | $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mCBm-0")' |
|
292 | $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mCBm-0")' | |
293 | M b |
|
293 | M b | |
294 | R a |
|
294 | R a | |
295 |
|
295 | |||
296 | - comparing with the merge children re-adding the file |
|
296 | - comparing with the merge children re-adding the file | |
297 |
|
297 | |||
298 | $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mBCm-1")' |
|
298 | $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mBCm-1")' | |
299 | M d |
|
299 | M d | |
300 | $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mCBm-1")' |
|
300 | $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mCBm-1")' | |
301 | M d |
|
301 | M d | |
302 | $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mBCm-1")' |
|
302 | $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mBCm-1")' | |
303 | M b |
|
303 | M b | |
304 | A d |
|
304 | A d | |
305 | $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mCBm-1")' |
|
305 | $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mCBm-1")' | |
306 | M b |
|
306 | M b | |
307 | A d |
|
307 | A d | |
308 | $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mBCm-1")' |
|
308 | $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mBCm-1")' | |
309 | M b |
|
309 | M b | |
310 | M d |
|
310 | M d | |
311 | $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mCBm-1")' |
|
311 | $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mCBm-1")' | |
312 | M b |
|
312 | M b | |
313 | M d |
|
313 | M d | |
314 | $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBCm-1")' |
|
314 | $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBCm-1")' | |
315 | M b |
|
315 | M b | |
316 | A d |
|
316 | A d | |
317 | R a |
|
317 | R a | |
318 | $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mCBm-1")' |
|
318 | $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mCBm-1")' | |
319 | M b |
|
319 | M b | |
320 | A d |
|
320 | A d | |
321 | R a |
|
321 | R a | |
322 |
|
322 | |||
323 | Comparing with a merge re-adding the file afterward |
|
323 | Comparing with a merge re-adding the file afterward | |
324 | --------------------------------------------------- |
|
324 | --------------------------------------------------- | |
325 |
|
325 | |||
326 | Merge: |
|
326 | Merge: | |
327 | - one with change to an unrelated file |
|
327 | - one with change to an unrelated file | |
328 | - one deleting and recreating the change |
|
328 | - one deleting and recreating the change | |
329 |
|
329 | |||
330 | $ hg up 'desc("b-1")' |
|
330 | $ hg up 'desc("b-1")' | |
331 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
331 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
332 | $ hg merge 'desc("d-2")' |
|
332 | $ hg merge 'desc("d-2")' | |
333 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
333 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
334 | (branch merge, don't forget to commit) |
|
334 | (branch merge, don't forget to commit) | |
335 | $ hg ci -m 'mBDm-0 simple merge - one way' |
|
335 | $ hg ci -m 'mBDm-0 simple merge - one way' | |
336 | $ hg up 'desc("d-2")' |
|
336 | $ hg up 'desc("d-2")' | |
337 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
337 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
338 | $ hg merge 'desc("b-1")' |
|
338 | $ hg merge 'desc("b-1")' | |
339 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
339 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
340 | (branch merge, don't forget to commit) |
|
340 | (branch merge, don't forget to commit) | |
341 | $ hg ci -m 'mDBm-0 simple merge - the other way' |
|
341 | $ hg ci -m 'mDBm-0 simple merge - the other way' | |
342 | created new head |
|
342 | created new head | |
343 | $ hg log -G --rev '::(desc("mDBm")+desc("mBDm"))' |
|
343 | $ hg log -G --rev '::(desc("mDBm")+desc("mBDm"))' | |
344 | @ 18 mDBm-0 simple merge - the other way |
|
344 | @ 18 mDBm-0 simple merge - the other way | |
345 | |\ |
|
345 | |\ | |
346 | +---o 17 mBDm-0 simple merge - one way |
|
346 | +---o 17 mBDm-0 simple merge - one way | |
347 | | |/ |
|
347 | | |/ | |
348 | | o 8 d-2 re-add d |
|
348 | | o 8 d-2 re-add d | |
349 | | | |
|
349 | | | | |
350 | | o 7 d-1 delete d |
|
350 | | o 7 d-1 delete d | |
351 | | | |
|
351 | | | | |
352 | o | 5 b-1: b update |
|
352 | o | 5 b-1: b update | |
353 | |/ |
|
353 | |/ | |
354 | o 2 i-2: c -move-> d |
|
354 | o 2 i-2: c -move-> d | |
355 | | |
|
355 | | | |
356 | o 1 i-1: a -move-> c |
|
356 | o 1 i-1: a -move-> c | |
357 | | |
|
357 | | | |
358 | o 0 i-0 initial commit: a b h |
|
358 | o 0 i-0 initial commit: a b h | |
359 |
|
359 | |||
360 | $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mBDm-0")' |
|
360 | $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mBDm-0")' | |
361 | M d |
|
361 | M d | |
362 | $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mDBm-0")' |
|
362 | $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mDBm-0")' | |
363 | M d |
|
363 | M d | |
364 | $ hg status --copies --rev 'desc("d-2")' --rev 'desc("mBDm-0")' |
|
364 | $ hg status --copies --rev 'desc("d-2")' --rev 'desc("mBDm-0")' | |
365 | M b |
|
365 | M b | |
366 | $ hg status --copies --rev 'desc("d-2")' --rev 'desc("mDBm-0")' |
|
366 | $ hg status --copies --rev 'desc("d-2")' --rev 'desc("mDBm-0")' | |
367 | M b |
|
367 | M b | |
368 | $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mBDm-0")' |
|
368 | $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mBDm-0")' | |
369 | M b |
|
369 | M b | |
370 | M d |
|
370 | M d | |
371 | $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mDBm-0")' |
|
371 | $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mDBm-0")' | |
372 | M b |
|
372 | M b | |
373 | M d |
|
373 | M d | |
374 |
|
374 | |||
375 | The bugs makes recorded copy is different depending of where we started the merge from since |
|
375 | The bugs makes recorded copy is different depending of where we started the merge from since | |
376 |
|
376 | |||
377 | $ hg manifest --debug --rev 'desc("mBDm-0")' | grep '644 d' |
|
377 | $ hg manifest --debug --rev 'desc("mBDm-0")' | grep '644 d' | |
378 | b004912a8510032a0350a74daa2803dadfb00e12 644 d |
|
378 | b004912a8510032a0350a74daa2803dadfb00e12 644 d | |
379 | $ hg manifest --debug --rev 'desc("mDBm-0")' | grep '644 d' |
|
379 | $ hg manifest --debug --rev 'desc("mDBm-0")' | grep '644 d' | |
380 | b004912a8510032a0350a74daa2803dadfb00e12 644 d |
|
380 | b004912a8510032a0350a74daa2803dadfb00e12 644 d | |
381 |
|
381 | |||
382 | $ hg manifest --debug --rev 'desc("d-2")' | grep '644 d' |
|
382 | $ hg manifest --debug --rev 'desc("d-2")' | grep '644 d' | |
383 | b004912a8510032a0350a74daa2803dadfb00e12 644 d |
|
383 | b004912a8510032a0350a74daa2803dadfb00e12 644 d | |
384 | $ hg manifest --debug --rev 'desc("b-1")' | grep '644 d' |
|
384 | $ hg manifest --debug --rev 'desc("b-1")' | grep '644 d' | |
385 | 01c2f5eabdc4ce2bdee42b5f86311955e6c8f573 644 d |
|
385 | 01c2f5eabdc4ce2bdee42b5f86311955e6c8f573 644 d | |
386 | $ hg debugindex d |
|
386 | $ hg debugindex d | |
387 | rev linkrev nodeid p1 p2 |
|
387 | rev linkrev nodeid p1 p2 | |
388 | 0 2 01c2f5eabdc4 000000000000 000000000000 |
|
388 | 0 2 01c2f5eabdc4 000000000000 000000000000 | |
389 | 1 8 b004912a8510 000000000000 000000000000 |
|
389 | 1 8 b004912a8510 000000000000 000000000000 | |
390 |
|
390 | |||
391 | Log output should not include a merge commit as it did not happen |
|
391 | Log output should not include a merge commit as it did not happen | |
392 |
|
392 | |||
393 | $ hg log -Gfr 'desc("mBDm-0")' d |
|
393 | $ hg log -Gfr 'desc("mBDm-0")' d | |
394 | o 8 d-2 re-add d |
|
394 | o 8 d-2 re-add d | |
395 | | |
|
395 | | | |
396 | ~ |
|
396 | ~ | |
397 |
|
397 | |||
398 | $ hg log -Gfr 'desc("mDBm-0")' d |
|
398 | $ hg log -Gfr 'desc("mDBm-0")' d | |
399 | o 8 d-2 re-add d |
|
399 | o 8 d-2 re-add d | |
400 | | |
|
400 | | | |
401 | ~ |
|
401 | ~ | |
402 |
|
402 | |||
403 | $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBDm-0")' |
|
403 | $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBDm-0")' | |
404 | M b |
|
404 | M b | |
405 | A d |
|
405 | A d | |
406 | R a |
|
406 | R a | |
407 | $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mDBm-0")' |
|
407 | $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mDBm-0")' | |
408 | M b |
|
408 | M b | |
409 | A d |
|
409 | A d | |
410 | R a |
|
410 | R a | |
411 |
|
411 | |||
412 |
|
412 | |||
413 | Comparing with a merge with colliding rename |
|
413 | Comparing with a merge with colliding rename | |
414 | -------------------------------------------- |
|
414 | -------------------------------------------- | |
415 |
|
415 | |||
416 | - the "e-" branch renaming b to f (through 'g') |
|
416 | - the "e-" branch renaming b to f (through 'g') | |
417 | - the "a-" branch renaming d to f (through e) |
|
417 | - the "a-" branch renaming d to f (through e) | |
418 |
|
418 | |||
419 | $ hg up 'desc("a-2")' |
|
419 | $ hg up 'desc("a-2")' | |
420 | 2 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
420 | 2 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
421 | $ hg merge 'desc("e-2")' |
|
421 | $ hg merge 'desc("e-2")' | |
422 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
422 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
423 | (branch merge, don't forget to commit) |
|
423 | (branch merge, don't forget to commit) | |
424 | $ hg ci -m 'mAEm-0 simple merge - one way' |
|
424 | $ hg ci -m 'mAEm-0 simple merge - one way' | |
425 | $ hg up 'desc("e-2")' |
|
425 | $ hg up 'desc("e-2")' | |
426 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
426 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
427 | $ hg merge 'desc("a-2")' |
|
427 | $ hg merge 'desc("a-2")' | |
428 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
428 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
429 | (branch merge, don't forget to commit) |
|
429 | (branch merge, don't forget to commit) | |
430 | $ hg ci -m 'mEAm-0 simple merge - the other way' |
|
430 | $ hg ci -m 'mEAm-0 simple merge - the other way' | |
431 | created new head |
|
431 | created new head | |
432 | $ hg log -G --rev '::(desc("mAEm")+desc("mEAm"))' |
|
432 | $ hg log -G --rev '::(desc("mAEm")+desc("mEAm"))' | |
433 | @ 20 mEAm-0 simple merge - the other way |
|
433 | @ 20 mEAm-0 simple merge - the other way | |
434 | |\ |
|
434 | |\ | |
435 | +---o 19 mAEm-0 simple merge - one way |
|
435 | +---o 19 mAEm-0 simple merge - one way | |
436 | | |/ |
|
436 | | |/ | |
437 | | o 10 e-2 g -move-> f |
|
437 | | o 10 e-2 g -move-> f | |
438 | | | |
|
438 | | | | |
439 | | o 9 e-1 b -move-> g |
|
439 | | o 9 e-1 b -move-> g | |
440 | | | |
|
440 | | | | |
441 | o | 4 a-2: e -move-> f |
|
441 | o | 4 a-2: e -move-> f | |
442 | | | |
|
442 | | | | |
443 | o | 3 a-1: d -move-> e |
|
443 | o | 3 a-1: d -move-> e | |
444 | |/ |
|
444 | |/ | |
445 | o 2 i-2: c -move-> d |
|
445 | o 2 i-2: c -move-> d | |
446 | | |
|
446 | | | |
447 | o 1 i-1: a -move-> c |
|
447 | o 1 i-1: a -move-> c | |
448 | | |
|
448 | | | |
449 | o 0 i-0 initial commit: a b h |
|
449 | o 0 i-0 initial commit: a b h | |
450 |
|
450 | |||
451 | $ hg manifest --debug --rev 'desc("mAEm-0")' | grep '644 f' |
|
451 | $ hg manifest --debug --rev 'desc("mAEm-0")' | grep '644 f' | |
452 | eb806e34ef6be4c264effd5933d31004ad15a793 644 f |
|
452 | eb806e34ef6be4c264effd5933d31004ad15a793 644 f | |
453 | $ hg manifest --debug --rev 'desc("mEAm-0")' | grep '644 f' |
|
453 | $ hg manifest --debug --rev 'desc("mEAm-0")' | grep '644 f' | |
454 | eb806e34ef6be4c264effd5933d31004ad15a793 644 f |
|
454 | eb806e34ef6be4c264effd5933d31004ad15a793 644 f | |
455 | $ hg manifest --debug --rev 'desc("a-2")' | grep '644 f' |
|
455 | $ hg manifest --debug --rev 'desc("a-2")' | grep '644 f' | |
456 | 0dd616bc7ab1a111921d95d76f69cda5c2ac539c 644 f |
|
456 | 0dd616bc7ab1a111921d95d76f69cda5c2ac539c 644 f | |
457 | $ hg manifest --debug --rev 'desc("e-2")' | grep '644 f' |
|
457 | $ hg manifest --debug --rev 'desc("e-2")' | grep '644 f' | |
458 | 6da5a2eecb9c833f830b67a4972366d49a9a142c 644 f |
|
458 | 6da5a2eecb9c833f830b67a4972366d49a9a142c 644 f | |
459 | $ hg debugindex f |
|
459 | $ hg debugindex f | |
460 | rev linkrev nodeid p1 p2 |
|
460 | rev linkrev nodeid p1 p2 | |
461 | 0 4 0dd616bc7ab1 000000000000 000000000000 |
|
461 | 0 4 0dd616bc7ab1 000000000000 000000000000 | |
462 | 1 10 6da5a2eecb9c 000000000000 000000000000 |
|
462 | 1 10 6da5a2eecb9c 000000000000 000000000000 | |
463 | 2 19 eb806e34ef6b 0dd616bc7ab1 6da5a2eecb9c |
|
463 | 2 19 eb806e34ef6b 0dd616bc7ab1 6da5a2eecb9c | |
464 |
|
464 | |||
465 | # Here the filelog based implementation is not looking at the rename |
|
465 | # Here the filelog based implementation is not looking at the rename | |
466 | # information (because the file exist on both side). However the changelog |
|
466 | # information (because the file exist on both side). However the changelog | |
467 | # based on works fine. We have different output. |
|
467 | # based on works fine. We have different output. | |
468 |
|
468 | |||
469 | $ hg status --copies --rev 'desc("a-2")' --rev 'desc("mAEm-0")' |
|
469 | $ hg status --copies --rev 'desc("a-2")' --rev 'desc("mAEm-0")' | |
470 | M f |
|
470 | M f | |
471 | b (no-filelog !) |
|
471 | b (no-filelog !) | |
472 | R b |
|
472 | R b | |
473 | $ hg status --copies --rev 'desc("a-2")' --rev 'desc("mEAm-0")' |
|
473 | $ hg status --copies --rev 'desc("a-2")' --rev 'desc("mEAm-0")' | |
474 | M f |
|
474 | M f | |
475 | b (no-filelog !) |
|
475 | b (no-filelog !) | |
476 | R b |
|
476 | R b | |
477 | $ hg status --copies --rev 'desc("e-2")' --rev 'desc("mAEm-0")' |
|
477 | $ hg status --copies --rev 'desc("e-2")' --rev 'desc("mAEm-0")' | |
478 | M f |
|
478 | M f | |
479 | d (no-filelog !) |
|
479 | d (no-filelog !) | |
480 | R d |
|
480 | R d | |
481 | $ hg status --copies --rev 'desc("e-2")' --rev 'desc("mEAm-0")' |
|
481 | $ hg status --copies --rev 'desc("e-2")' --rev 'desc("mEAm-0")' | |
482 | M f |
|
482 | M f | |
483 | d (no-filelog !) |
|
483 | d (no-filelog !) | |
484 | R d |
|
484 | R d | |
485 | $ hg status --copies --rev 'desc("i-2")' --rev 'desc("a-2")' |
|
485 | $ hg status --copies --rev 'desc("i-2")' --rev 'desc("a-2")' | |
486 | A f |
|
486 | A f | |
487 | d |
|
487 | d | |
488 | R d |
|
488 | R d | |
489 | $ hg status --copies --rev 'desc("i-2")' --rev 'desc("e-2")' |
|
489 | $ hg status --copies --rev 'desc("i-2")' --rev 'desc("e-2")' | |
490 | A f |
|
490 | A f | |
491 | b |
|
491 | b | |
492 | R b |
|
492 | R b | |
493 |
|
493 | |||
494 | # From here, we run status against revision where both source file exists. |
|
494 | # From here, we run status against revision where both source file exists. | |
495 | # |
|
495 | # | |
496 | # The filelog based implementation picks an arbitrary side based on revision |
|
496 | # The filelog based implementation picks an arbitrary side based on revision | |
497 | # numbers. So the same side "wins" whatever the parents order is. This is |
|
497 | # numbers. So the same side "wins" whatever the parents order is. This is | |
498 | # sub-optimal because depending on revision numbers means the result can be |
|
498 | # sub-optimal because depending on revision numbers means the result can be | |
499 | # different from one repository to the next. |
|
499 | # different from one repository to the next. | |
500 | # |
|
500 | # | |
501 | # The changeset based algorithm use the parent order to break tie on conflicting |
|
501 | # The changeset based algorithm use the parent order to break tie on conflicting | |
502 | # information and will have a different order depending on who is p1 and p2. |
|
502 | # information and will have a different order depending on who is p1 and p2. | |
503 | # That order is stable accross repositories. (data from p1 prevails) |
|
503 | # That order is stable accross repositories. (data from p1 prevails) | |
504 |
|
504 | |||
505 | $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mAEm-0")' |
|
505 | $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mAEm-0")' | |
506 | A f |
|
506 | A f | |
507 | d |
|
507 | d | |
508 | R b |
|
508 | R b | |
509 | R d |
|
509 | R d | |
510 | $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mEAm-0")' |
|
510 | $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mEAm-0")' | |
511 | A f |
|
511 | A f | |
512 | d (filelog !) |
|
512 | d (filelog !) | |
513 | b (no-filelog !) |
|
513 | b (no-filelog !) | |
514 | R b |
|
514 | R b | |
515 | R d |
|
515 | R d | |
516 | $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mAEm-0")' |
|
516 | $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mAEm-0")' | |
517 | A f |
|
517 | A f | |
518 | a |
|
518 | a | |
519 | R a |
|
519 | R a | |
520 | R b |
|
520 | R b | |
521 | $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mEAm-0")' |
|
521 | $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mEAm-0")' | |
522 | A f |
|
522 | A f | |
523 | a (filelog !) |
|
523 | a (filelog !) | |
524 | b (no-filelog !) |
|
524 | b (no-filelog !) | |
525 | R a |
|
525 | R a | |
526 | R b |
|
526 | R b | |
527 |
|
527 | |||
528 |
|
528 | |||
529 | Note: |
|
529 | Note: | |
530 | | In this case, one of the merge wrongly record a merge while there is none. |
|
530 | | In this case, one of the merge wrongly record a merge while there is none. | |
531 | | This lead to bad copy tracing information to be dug up. |
|
531 | | This lead to bad copy tracing information to be dug up. | |
532 |
|
532 | |||
533 |
|
533 | |||
534 | Merge: |
|
534 | Merge: | |
535 | - one with change to an unrelated file (b) |
|
535 | - one with change to an unrelated file (b) | |
536 | - one overwriting a file (d) with a rename (from h to i to d) |
|
536 | - one overwriting a file (d) with a rename (from h to i to d) | |
537 |
|
537 | |||
538 | $ hg up 'desc("i-2")' |
|
538 | $ hg up 'desc("i-2")' | |
539 | 2 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
539 | 2 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
540 | $ hg mv h i |
|
540 | $ hg mv h i | |
541 | $ hg commit -m "f-1: rename h -> i" |
|
541 | $ hg commit -m "f-1: rename h -> i" | |
542 | created new head |
|
542 | created new head | |
543 | $ hg mv --force i d |
|
543 | $ hg mv --force i d | |
544 | $ hg commit -m "f-2: rename i -> d" |
|
544 | $ hg commit -m "f-2: rename i -> d" | |
545 | $ hg debugindex d |
|
545 | $ hg debugindex d | |
546 | rev linkrev nodeid p1 p2 |
|
546 | rev linkrev nodeid p1 p2 | |
547 | 0 2 01c2f5eabdc4 000000000000 000000000000 |
|
547 | 0 2 01c2f5eabdc4 000000000000 000000000000 | |
548 | 1 8 b004912a8510 000000000000 000000000000 |
|
548 | 1 8 b004912a8510 000000000000 000000000000 | |
549 | 2 22 c72365ee036f 000000000000 000000000000 |
|
549 | 2 22 c72365ee036f 000000000000 000000000000 | |
550 | $ hg up 'desc("b-1")' |
|
550 | $ hg up 'desc("b-1")' | |
551 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
551 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
552 | $ hg merge 'desc("f-2")' |
|
552 | $ hg merge 'desc("f-2")' | |
553 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
553 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
554 | (branch merge, don't forget to commit) |
|
554 | (branch merge, don't forget to commit) | |
555 | $ hg ci -m 'mBFm-0 simple merge - one way' |
|
555 | $ hg ci -m 'mBFm-0 simple merge - one way' | |
556 | $ hg up 'desc("f-2")' |
|
556 | $ hg up 'desc("f-2")' | |
557 | 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 | |
558 | $ hg merge 'desc("b-1")' |
|
558 | $ hg merge 'desc("b-1")' | |
559 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
559 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
560 | (branch merge, don't forget to commit) |
|
560 | (branch merge, don't forget to commit) | |
561 | $ hg ci -m 'mFBm-0 simple merge - the other way' |
|
561 | $ hg ci -m 'mFBm-0 simple merge - the other way' | |
562 | created new head |
|
562 | created new head | |
563 | $ hg log -G --rev '::(desc("mBFm")+desc("mFBm"))' |
|
563 | $ hg log -G --rev '::(desc("mBFm")+desc("mFBm"))' | |
564 | @ 24 mFBm-0 simple merge - the other way |
|
564 | @ 24 mFBm-0 simple merge - the other way | |
565 | |\ |
|
565 | |\ | |
566 | +---o 23 mBFm-0 simple merge - one way |
|
566 | +---o 23 mBFm-0 simple merge - one way | |
567 | | |/ |
|
567 | | |/ | |
568 | | o 22 f-2: rename i -> d |
|
568 | | o 22 f-2: rename i -> d | |
569 | | | |
|
569 | | | | |
570 | | o 21 f-1: rename h -> i |
|
570 | | o 21 f-1: rename h -> i | |
571 | | | |
|
571 | | | | |
572 | o | 5 b-1: b update |
|
572 | o | 5 b-1: b update | |
573 | |/ |
|
573 | |/ | |
574 | o 2 i-2: c -move-> d |
|
574 | o 2 i-2: c -move-> d | |
575 | | |
|
575 | | | |
576 | o 1 i-1: a -move-> c |
|
576 | o 1 i-1: a -move-> c | |
577 | | |
|
577 | | | |
578 | o 0 i-0 initial commit: a b h |
|
578 | o 0 i-0 initial commit: a b h | |
579 |
|
579 | |||
580 | $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBFm-0")' |
|
580 | $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBFm-0")' | |
581 | M b |
|
581 | M b | |
582 | A d |
|
582 | A d | |
583 | h |
|
583 | h | |
584 | R a |
|
584 | R a | |
585 | R h |
|
585 | R h | |
586 | $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mFBm-0")' |
|
586 | $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mFBm-0")' | |
587 | M b |
|
587 | M b | |
588 | A d |
|
588 | A d | |
589 | h |
|
589 | h | |
590 | R a |
|
590 | R a | |
591 | R h |
|
591 | R h | |
592 | $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mBFm-0")' |
|
592 | $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mBFm-0")' | |
593 | M d |
|
593 | M d | |
594 | h (no-filelog !) |
|
594 | h (no-filelog !) | |
595 | R h |
|
595 | R h | |
596 | $ hg status --copies --rev 'desc("f-2")' --rev 'desc("mBFm-0")' |
|
596 | $ hg status --copies --rev 'desc("f-2")' --rev 'desc("mBFm-0")' | |
597 | M b |
|
597 | M b | |
598 | $ hg status --copies --rev 'desc("f-1")' --rev 'desc("mBFm-0")' |
|
598 | $ hg status --copies --rev 'desc("f-1")' --rev 'desc("mBFm-0")' | |
599 | M b |
|
599 | M b | |
600 | M d |
|
600 | M d | |
601 | i (no-filelog !) |
|
601 | i (no-filelog !) | |
602 | R i |
|
602 | R i | |
603 | $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mFBm-0")' |
|
603 | $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mFBm-0")' | |
604 | M d |
|
604 | M d | |
605 | h (no-filelog !) |
|
605 | h (no-filelog !) | |
606 | R h |
|
606 | R h | |
607 | $ hg status --copies --rev 'desc("f-2")' --rev 'desc("mFBm-0")' |
|
607 | $ hg status --copies --rev 'desc("f-2")' --rev 'desc("mFBm-0")' | |
608 | M b |
|
608 | M b | |
609 | $ hg status --copies --rev 'desc("f-1")' --rev 'desc("mFBm-0")' |
|
609 | $ hg status --copies --rev 'desc("f-1")' --rev 'desc("mFBm-0")' | |
610 | M b |
|
610 | M b | |
611 | M d |
|
611 | M d | |
612 | i (no-filelog !) |
|
612 | i (no-filelog !) | |
613 | R i |
|
613 | R i | |
614 |
|
614 | |||
615 | $ hg log -Gfr 'desc("mBFm-0")' d |
|
615 | $ hg log -Gfr 'desc("mBFm-0")' d | |
616 | o 22 f-2: rename i -> d |
|
616 | o 22 f-2: rename i -> d | |
617 | | |
|
617 | | | |
618 | o 21 f-1: rename h -> i |
|
618 | o 21 f-1: rename h -> i | |
619 | : |
|
619 | : | |
620 | o 0 i-0 initial commit: a b h |
|
620 | o 0 i-0 initial commit: a b h | |
621 |
|
621 | |||
622 |
|
622 | |||
623 | $ hg log -Gfr 'desc("mFBm-0")' d |
|
623 | $ hg log -Gfr 'desc("mFBm-0")' d | |
624 | o 22 f-2: rename i -> d |
|
624 | o 22 f-2: rename i -> d | |
625 | | |
|
625 | | | |
626 | o 21 f-1: rename h -> i |
|
626 | o 21 f-1: rename h -> i | |
627 | : |
|
627 | : | |
628 | o 0 i-0 initial commit: a b h |
|
628 | o 0 i-0 initial commit: a b h | |
629 |
|
629 | |||
630 |
|
630 | |||
631 |
|
631 | |||
632 | Merge: |
|
632 | Merge: | |
633 | - one with change to a file |
|
633 | - one with change to a file | |
634 | - one deleting and recreating the file |
|
634 | - one deleting and recreating the file | |
635 |
|
635 | |||
636 | Unlike in the 'BD/DB' cases, an actual merge happened here. So we should |
|
636 | Unlike in the 'BD/DB' cases, an actual merge happened here. So we should | |
637 | consider history and rename on both branch of the merge. |
|
637 | consider history and rename on both branch of the merge. | |
638 |
|
638 | |||
639 | $ hg up 'desc("i-2")' |
|
639 | $ hg up 'desc("i-2")' | |
640 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
640 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
641 | $ echo "some update" >> d |
|
641 | $ echo "some update" >> d | |
642 | $ hg commit -m "g-1: update d" |
|
642 | $ hg commit -m "g-1: update d" | |
643 | created new head |
|
643 | created new head | |
644 | $ hg up 'desc("d-2")' |
|
644 | $ hg up 'desc("d-2")' | |
645 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
645 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
646 | $ hg merge 'desc("g-1")' --tool :union |
|
646 | $ hg merge 'desc("g-1")' --tool :union | |
647 | merging d |
|
647 | merging d | |
648 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
648 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
649 | (branch merge, don't forget to commit) |
|
649 | (branch merge, don't forget to commit) | |
650 | $ hg ci -m 'mDGm-0 simple merge - one way' |
|
650 | $ hg ci -m 'mDGm-0 simple merge - one way' | |
651 | $ hg up 'desc("g-1")' |
|
651 | $ hg up 'desc("g-1")' | |
652 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
652 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
653 | $ hg merge 'desc("d-2")' --tool :union |
|
653 | $ hg merge 'desc("d-2")' --tool :union | |
654 | merging d |
|
654 | merging d | |
655 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
655 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
656 | (branch merge, don't forget to commit) |
|
656 | (branch merge, don't forget to commit) | |
657 | $ hg ci -m 'mGDm-0 simple merge - the other way' |
|
657 | $ hg ci -m 'mGDm-0 simple merge - the other way' | |
658 | created new head |
|
658 | created new head | |
659 | $ hg log -G --rev '::(desc("mDGm")+desc("mGDm"))' |
|
659 | $ hg log -G --rev '::(desc("mDGm")+desc("mGDm"))' | |
660 | @ 27 mGDm-0 simple merge - the other way |
|
660 | @ 27 mGDm-0 simple merge - the other way | |
661 | |\ |
|
661 | |\ | |
662 | +---o 26 mDGm-0 simple merge - one way |
|
662 | +---o 26 mDGm-0 simple merge - one way | |
663 | | |/ |
|
663 | | |/ | |
664 | | o 25 g-1: update d |
|
664 | | o 25 g-1: update d | |
665 | | | |
|
665 | | | | |
666 | o | 8 d-2 re-add d |
|
666 | o | 8 d-2 re-add d | |
667 | | | |
|
667 | | | | |
668 | o | 7 d-1 delete d |
|
668 | o | 7 d-1 delete d | |
669 | |/ |
|
669 | |/ | |
670 | o 2 i-2: c -move-> d |
|
670 | o 2 i-2: c -move-> d | |
671 | | |
|
671 | | | |
672 | o 1 i-1: a -move-> c |
|
672 | o 1 i-1: a -move-> c | |
673 | | |
|
673 | | | |
674 | o 0 i-0 initial commit: a b h |
|
674 | o 0 i-0 initial commit: a b h | |
675 |
|
675 | |||
676 | One side of the merge have a long history with rename. The other side of the |
|
676 | One side of the merge have a long history with rename. The other side of the | |
677 | merge point to a new file with a smaller history. Each side is "valid". |
|
677 | merge point to a new file with a smaller history. Each side is "valid". | |
678 |
|
678 | |||
679 | (and again the filelog based algorithm only explore one, with a pick based on |
|
679 | (and again the filelog based algorithm only explore one, with a pick based on | |
680 | revision numbers) |
|
680 | revision numbers) | |
681 |
|
681 | |||
682 | $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mDGm-0")' |
|
682 | $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mDGm-0")' | |
683 | A d |
|
683 | A d | |
684 | a (filelog !) |
|
684 | a (filelog !) | |
685 | R a |
|
685 | R a | |
686 | $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mGDm-0")' |
|
686 | $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mGDm-0")' | |
687 | A d |
|
687 | A d | |
688 | a |
|
688 | a | |
689 | R a |
|
689 | R a | |
690 | $ hg status --copies --rev 'desc("d-2")' --rev 'desc("mDGm-0")' |
|
690 | $ hg status --copies --rev 'desc("d-2")' --rev 'desc("mDGm-0")' | |
691 | M d |
|
691 | M d | |
692 | $ hg status --copies --rev 'desc("d-2")' --rev 'desc("mGDm-0")' |
|
692 | $ hg status --copies --rev 'desc("d-2")' --rev 'desc("mGDm-0")' | |
693 | M d |
|
693 | M d | |
694 | $ hg status --copies --rev 'desc("g-1")' --rev 'desc("mDGm-0")' |
|
694 | $ hg status --copies --rev 'desc("g-1")' --rev 'desc("mDGm-0")' | |
695 | M d |
|
695 | M d | |
696 | $ hg status --copies --rev 'desc("g-1")' --rev 'desc("mGDm-0")' |
|
696 | $ hg status --copies --rev 'desc("g-1")' --rev 'desc("mGDm-0")' | |
697 | M d |
|
697 | M d | |
698 |
|
698 | |||
699 | $ hg log -Gfr 'desc("mDGm-0")' d |
|
699 | $ hg log -Gfr 'desc("mDGm-0")' d | |
700 | o 26 mDGm-0 simple merge - one way |
|
700 | o 26 mDGm-0 simple merge - one way | |
701 | |\ |
|
701 | |\ | |
702 | | o 25 g-1: update d |
|
702 | | o 25 g-1: update d | |
703 | | | |
|
703 | | | | |
704 | o | 8 d-2 re-add d |
|
704 | o | 8 d-2 re-add d | |
705 | |/ |
|
705 | |/ | |
706 | o 2 i-2: c -move-> d |
|
706 | o 2 i-2: c -move-> d | |
707 | | |
|
707 | | | |
708 | o 1 i-1: a -move-> c |
|
708 | o 1 i-1: a -move-> c | |
709 | | |
|
709 | | | |
710 | o 0 i-0 initial commit: a b h |
|
710 | o 0 i-0 initial commit: a b h | |
711 |
|
711 | |||
712 |
|
712 | |||
713 |
|
713 | |||
714 | $ hg log -Gfr 'desc("mDGm-0")' d |
|
714 | $ hg log -Gfr 'desc("mDGm-0")' d | |
715 | o 26 mDGm-0 simple merge - one way |
|
715 | o 26 mDGm-0 simple merge - one way | |
716 | |\ |
|
716 | |\ | |
717 | | o 25 g-1: update d |
|
717 | | o 25 g-1: update d | |
718 | | | |
|
718 | | | | |
719 | o | 8 d-2 re-add d |
|
719 | o | 8 d-2 re-add d | |
720 | |/ |
|
720 | |/ | |
721 | o 2 i-2: c -move-> d |
|
721 | o 2 i-2: c -move-> d | |
722 | | |
|
722 | | | |
723 | o 1 i-1: a -move-> c |
|
723 | o 1 i-1: a -move-> c | |
724 | | |
|
724 | | | |
725 | o 0 i-0 initial commit: a b h |
|
725 | o 0 i-0 initial commit: a b h | |
726 |
|
726 | |||
727 |
|
727 | |||
728 |
|
728 | |||
729 | Merge: |
|
729 | Merge: | |
730 | - one with change to a file (d) |
|
730 | - one with change to a file (d) | |
731 | - one overwriting that file with a rename (from h to i, to d) |
|
731 | - one overwriting that file with a rename (from h to i, to d) | |
732 |
|
732 | |||
733 | This case is similar to BF/FB, but an actual merge happens, so both side of the |
|
733 | This case is similar to BF/FB, but an actual merge happens, so both side of the | |
734 | history are relevant. |
|
734 | history are relevant. | |
735 |
|
735 | |||
736 | Note: |
|
736 | Note: | |
737 | | In this case, the merge get conflicting information since on one side we have |
|
737 | | In this case, the merge get conflicting information since on one side we have | |
738 | | "a -> c -> d". and one the other one we have "h -> i -> d". |
|
738 | | "a -> c -> d". and one the other one we have "h -> i -> d". | |
739 | | |
|
739 | | | |
740 | | The current code arbitrarily pick one side |
|
740 | | The current code arbitrarily pick one side | |
741 |
|
741 | |||
742 | $ hg up 'desc("f-2")' |
|
742 | $ hg up 'desc("f-2")' | |
743 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
743 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
744 | $ hg merge 'desc("g-1")' --tool :union |
|
744 | $ hg merge 'desc("g-1")' --tool :union | |
745 | merging d |
|
745 | merging d | |
746 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
746 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved | |
747 | (branch merge, don't forget to commit) |
|
747 | (branch merge, don't forget to commit) | |
748 | $ hg ci -m 'mFGm-0 simple merge - one way' |
|
748 | $ hg ci -m 'mFGm-0 simple merge - one way' | |
749 | created new head |
|
749 | created new head | |
750 | $ hg up 'desc("g-1")' |
|
750 | $ hg up 'desc("g-1")' | |
751 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
751 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
752 | $ hg merge 'desc("f-2")' --tool :union |
|
752 | $ hg merge 'desc("f-2")' --tool :union | |
753 | merging d |
|
753 | merging d | |
754 | 0 files updated, 1 files merged, 1 files removed, 0 files unresolved |
|
754 | 0 files updated, 1 files merged, 1 files removed, 0 files unresolved | |
755 | (branch merge, don't forget to commit) |
|
755 | (branch merge, don't forget to commit) | |
756 | $ hg ci -m 'mGFm-0 simple merge - the other way' |
|
756 | $ hg ci -m 'mGFm-0 simple merge - the other way' | |
757 | created new head |
|
757 | created new head | |
758 | $ hg log -G --rev '::(desc("mGFm")+desc("mFGm"))' |
|
758 | $ hg log -G --rev '::(desc("mGFm")+desc("mFGm"))' | |
759 | @ 29 mGFm-0 simple merge - the other way |
|
759 | @ 29 mGFm-0 simple merge - the other way | |
760 | |\ |
|
760 | |\ | |
761 | +---o 28 mFGm-0 simple merge - one way |
|
761 | +---o 28 mFGm-0 simple merge - one way | |
762 | | |/ |
|
762 | | |/ | |
763 | | o 25 g-1: update d |
|
763 | | o 25 g-1: update d | |
764 | | | |
|
764 | | | | |
765 | o | 22 f-2: rename i -> d |
|
765 | o | 22 f-2: rename i -> d | |
766 | | | |
|
766 | | | | |
767 | o | 21 f-1: rename h -> i |
|
767 | o | 21 f-1: rename h -> i | |
768 | |/ |
|
768 | |/ | |
769 | o 2 i-2: c -move-> d |
|
769 | o 2 i-2: c -move-> d | |
770 | | |
|
770 | | | |
771 | o 1 i-1: a -move-> c |
|
771 | o 1 i-1: a -move-> c | |
772 | | |
|
772 | | | |
773 | o 0 i-0 initial commit: a b h |
|
773 | o 0 i-0 initial commit: a b h | |
774 |
|
774 | |||
775 | $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mFGm-0")' |
|
775 | $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mFGm-0")' | |
776 | A d |
|
776 | A d | |
777 | h (no-filelog !) |
|
777 | h (no-filelog !) | |
778 | a (filelog !) |
|
778 | a (filelog !) | |
779 | R a |
|
779 | R a | |
780 | R h |
|
780 | R h | |
781 | $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mGFm-0")' |
|
781 | $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mGFm-0")' | |
782 | A d |
|
782 | A d | |
783 | a |
|
783 | a | |
784 | R a |
|
784 | R a | |
785 | R h |
|
785 | R h | |
786 | $ hg status --copies --rev 'desc("f-2")' --rev 'desc("mFGm-0")' |
|
786 | $ hg status --copies --rev 'desc("f-2")' --rev 'desc("mFGm-0")' | |
787 | M d |
|
787 | M d | |
788 | $ hg status --copies --rev 'desc("f-2")' --rev 'desc("mGFm-0")' |
|
788 | $ hg status --copies --rev 'desc("f-2")' --rev 'desc("mGFm-0")' | |
789 | M d |
|
789 | M d | |
790 | $ hg status --copies --rev 'desc("f-1")' --rev 'desc("mFGm-0")' |
|
790 | $ hg status --copies --rev 'desc("f-1")' --rev 'desc("mFGm-0")' | |
791 | M d |
|
791 | M d | |
792 | i (no-filelog !) |
|
792 | i (no-filelog !) | |
793 | R i |
|
793 | R i | |
794 | $ hg status --copies --rev 'desc("f-1")' --rev 'desc("mGFm-0")' |
|
794 | $ hg status --copies --rev 'desc("f-1")' --rev 'desc("mGFm-0")' | |
795 | M d |
|
795 | M d | |
796 | i (no-filelog !) |
|
796 | i (no-filelog !) | |
797 | R i |
|
797 | R i | |
798 | $ hg status --copies --rev 'desc("g-1")' --rev 'desc("mFGm-0")' |
|
798 | $ hg status --copies --rev 'desc("g-1")' --rev 'desc("mFGm-0")' | |
799 | M d |
|
799 | M d | |
800 | h (no-filelog !) |
|
800 | h (no-filelog !) | |
801 | R h |
|
801 | R h | |
802 | $ hg status --copies --rev 'desc("g-1")' --rev 'desc("mGFm-0")' |
|
802 | $ hg status --copies --rev 'desc("g-1")' --rev 'desc("mGFm-0")' | |
803 | M d |
|
803 | M d | |
804 | h (no-filelog !) |
|
804 | h (no-filelog !) | |
805 | R h |
|
805 | R h | |
806 |
|
806 | |||
807 | $ hg log -Gfr 'desc("mFGm-0")' d |
|
807 | $ hg log -Gfr 'desc("mFGm-0")' d | |
808 | o 28 mFGm-0 simple merge - one way |
|
808 | o 28 mFGm-0 simple merge - one way | |
809 | |\ |
|
809 | |\ | |
810 | | o 25 g-1: update d |
|
810 | | o 25 g-1: update d | |
811 | | | |
|
811 | | | | |
812 | o | 22 f-2: rename i -> d |
|
812 | o | 22 f-2: rename i -> d | |
813 | | | |
|
813 | | | | |
814 | o | 21 f-1: rename h -> i |
|
814 | o | 21 f-1: rename h -> i | |
815 | |/ |
|
815 | |/ | |
816 | o 2 i-2: c -move-> d |
|
816 | o 2 i-2: c -move-> d | |
817 | | |
|
817 | | | |
818 | o 1 i-1: a -move-> c |
|
818 | o 1 i-1: a -move-> c | |
819 | | |
|
819 | | | |
820 | o 0 i-0 initial commit: a b h |
|
820 | o 0 i-0 initial commit: a b h | |
821 |
|
821 | |||
822 |
|
822 | |||
823 | $ hg log -Gfr 'desc("mGFm-0")' d |
|
823 | $ hg log -Gfr 'desc("mGFm-0")' d | |
824 | @ 29 mGFm-0 simple merge - the other way |
|
824 | @ 29 mGFm-0 simple merge - the other way | |
825 | |\ |
|
825 | |\ | |
826 | | o 25 g-1: update d |
|
826 | | o 25 g-1: update d | |
827 | | | |
|
827 | | | | |
828 | o | 22 f-2: rename i -> d |
|
828 | o | 22 f-2: rename i -> d | |
829 | | | |
|
829 | | | | |
830 | o | 21 f-1: rename h -> i |
|
830 | o | 21 f-1: rename h -> i | |
831 | |/ |
|
831 | |/ | |
832 | o 2 i-2: c -move-> d |
|
832 | o 2 i-2: c -move-> d | |
833 | | |
|
833 | | | |
834 | o 1 i-1: a -move-> c |
|
834 | o 1 i-1: a -move-> c | |
835 | | |
|
835 | | | |
836 | o 0 i-0 initial commit: a b h |
|
836 | o 0 i-0 initial commit: a b h | |
837 |
|
837 | |||
838 |
|
838 | |||
839 |
|
839 | |||
840 | Comparing with merging with a deletion (and keeping the file) |
|
840 | Comparing with merging with a deletion (and keeping the file) | |
841 | ------------------------------------------------------------- |
|
841 | ------------------------------------------------------------- | |
842 |
|
842 | |||
843 | Merge: |
|
843 | Merge: | |
844 | - one removing a file (d) |
|
844 | - one removing a file (d) | |
845 | - one updating that file |
|
845 | - one updating that file | |
846 | - the merge keep the modified version of the file (canceling the delete) |
|
846 | - the merge keep the modified version of the file (canceling the delete) | |
847 |
|
847 | |||
848 | In this case, the file keep on living after the merge. So we should not drop its |
|
848 | In this case, the file keep on living after the merge. So we should not drop its | |
849 | copy tracing chain. |
|
849 | copy tracing chain. | |
850 |
|
850 | |||
851 | $ hg up 'desc("c-1")' |
|
851 | $ hg up 'desc("c-1")' | |
852 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
852 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
853 | $ hg merge 'desc("g-1")' |
|
853 | $ hg merge 'desc("g-1")' | |
854 | file 'd' was deleted in local [working copy] but was modified in other [merge rev]. |
|
854 | file 'd' was deleted in local [working copy] but was modified in other [merge rev]. | |
855 | You can use (c)hanged version, leave (d)eleted, or leave (u)nresolved. |
|
855 | You can use (c)hanged version, leave (d)eleted, or leave (u)nresolved. | |
856 | What do you want to do? u |
|
856 | What do you want to do? u | |
857 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
857 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved | |
858 | use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon |
|
858 | use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon | |
859 | [1] |
|
859 | [1] | |
860 | $ hg resolve -t :other d |
|
860 | $ hg resolve -t :other d | |
861 | (no more unresolved files) |
|
861 | (no more unresolved files) | |
862 | $ hg ci -m "mCGm-0" |
|
862 | $ hg ci -m "mCGm-0" | |
863 | created new head |
|
863 | created new head | |
864 |
|
864 | |||
865 | $ hg up 'desc("g-1")' |
|
865 | $ hg up 'desc("g-1")' | |
866 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
866 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
867 | $ hg merge 'desc("c-1")' |
|
867 | $ hg merge 'desc("c-1")' | |
868 | file 'd' was deleted in other [merge rev] but was modified in local [working copy]. |
|
868 | file 'd' was deleted in other [merge rev] but was modified in local [working copy]. | |
869 | You can use (c)hanged version, (d)elete, or leave (u)nresolved. |
|
869 | You can use (c)hanged version, (d)elete, or leave (u)nresolved. | |
870 | What do you want to do? u |
|
870 | What do you want to do? u | |
871 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
871 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved | |
872 | use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon |
|
872 | use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon | |
873 | [1] |
|
873 | [1] | |
874 | $ hg resolve -t :local d |
|
874 | $ hg resolve -t :local d | |
875 | (no more unresolved files) |
|
875 | (no more unresolved files) | |
876 | $ hg ci -m "mGCm-0" |
|
876 | $ hg ci -m "mGCm-0" | |
877 | created new head |
|
877 | created new head | |
878 |
|
878 | |||
879 | $ hg log -G --rev '::(desc("mCGm")+desc("mGCm"))' |
|
879 | $ hg log -G --rev '::(desc("mCGm")+desc("mGCm"))' | |
880 | @ 31 mGCm-0 |
|
880 | @ 31 mGCm-0 | |
881 | |\ |
|
881 | |\ | |
882 | +---o 30 mCGm-0 |
|
882 | +---o 30 mCGm-0 | |
883 | | |/ |
|
883 | | |/ | |
884 | | o 25 g-1: update d |
|
884 | | o 25 g-1: update d | |
885 | | | |
|
885 | | | | |
886 | o | 6 c-1 delete d |
|
886 | o | 6 c-1 delete d | |
887 | |/ |
|
887 | |/ | |
888 | o 2 i-2: c -move-> d |
|
888 | o 2 i-2: c -move-> d | |
889 | | |
|
889 | | | |
890 | o 1 i-1: a -move-> c |
|
890 | o 1 i-1: a -move-> c | |
891 | | |
|
891 | | | |
892 | o 0 i-0 initial commit: a b h |
|
892 | o 0 i-0 initial commit: a b h | |
893 |
|
893 | |||
894 |
|
894 | |||
895 | BROKEN: 'a' should be the the source of 'd' in the changeset centric algorithm too |
|
895 | BROKEN: 'a' should be the the source of 'd' in the changeset centric algorithm too | |
896 |
|
896 | |||
897 | $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mCGm-0")' |
|
897 | $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mCGm-0")' | |
898 | A d |
|
898 | A d | |
899 | a (filelog !) |
|
899 | a (filelog !) | |
900 | R a |
|
900 | R a | |
901 | $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mGCm-0")' |
|
901 | $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mGCm-0")' | |
902 | A d |
|
902 | A d | |
903 | a (filelog !) |
|
903 | a (filelog !) | |
904 | R a |
|
904 | R a | |
905 | $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mCGm-0")' |
|
905 | $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mCGm-0")' | |
906 | A d |
|
906 | A d | |
907 | $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mGCm-0")' |
|
907 | $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mGCm-0")' | |
908 | A d |
|
908 | A d | |
909 | $ hg status --copies --rev 'desc("g-1")' --rev 'desc("mCGm-0")' |
|
909 | $ hg status --copies --rev 'desc("g-1")' --rev 'desc("mCGm-0")' | |
910 | $ hg status --copies --rev 'desc("g-1")' --rev 'desc("mGCm-0")' |
|
910 | $ hg status --copies --rev 'desc("g-1")' --rev 'desc("mGCm-0")' | |
911 |
|
911 | |||
912 |
|
912 | |||
913 | Comparing with merge restoring an untouched deleted file |
|
913 | Comparing with merge restoring an untouched deleted file | |
914 | -------------------------------------------------------- |
|
914 | -------------------------------------------------------- | |
915 |
|
915 | |||
916 | Merge: |
|
916 | Merge: | |
917 | - one removing a file (d) |
|
917 | - one removing a file (d) | |
918 | - one leaving the file untouched |
|
918 | - one leaving the file untouched | |
919 | - the merge actively restore the file to the same content. |
|
919 | - the merge actively restore the file to the same content. | |
920 |
|
920 | |||
921 | In this case, the file keep on living after the merge. So we should not drop its |
|
921 | In this case, the file keep on living after the merge. So we should not drop its | |
922 | copy tracing chain. |
|
922 | copy tracing chain. | |
923 |
|
923 | |||
924 | $ hg up 'desc("c-1")' |
|
924 | $ hg up 'desc("c-1")' | |
925 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
925 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
926 | $ hg merge 'desc("b-1")' |
|
926 | $ hg merge 'desc("b-1")' | |
927 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
927 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
928 | (branch merge, don't forget to commit) |
|
928 | (branch merge, don't forget to commit) | |
929 | $ hg revert --rev 'desc("b-1")' d |
|
929 | $ hg revert --rev 'desc("b-1")' d | |
930 | $ hg ci -m "mCB-revert-m-0" |
|
930 | $ hg ci -m "mCB-revert-m-0" | |
931 | created new head |
|
931 | created new head | |
932 |
|
932 | |||
933 | $ hg up 'desc("b-1")' |
|
933 | $ hg up 'desc("b-1")' | |
934 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
934 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
935 | $ hg merge 'desc("c-1")' |
|
935 | $ hg merge 'desc("c-1")' | |
936 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
936 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
937 | (branch merge, don't forget to commit) |
|
937 | (branch merge, don't forget to commit) | |
938 | $ hg revert --rev 'desc("b-1")' d |
|
938 | $ hg revert --rev 'desc("b-1")' d | |
939 | $ hg ci -m "mBC-revert-m-0" |
|
939 | $ hg ci -m "mBC-revert-m-0" | |
940 | created new head |
|
940 | created new head | |
941 |
|
941 | |||
942 | $ hg log -G --rev '::(desc("mCB-revert-m")+desc("mBC-revert-m"))' |
|
942 | $ hg log -G --rev '::(desc("mCB-revert-m")+desc("mBC-revert-m"))' | |
943 | @ 33 mBC-revert-m-0 |
|
943 | @ 33 mBC-revert-m-0 | |
944 | |\ |
|
944 | |\ | |
945 | +---o 32 mCB-revert-m-0 |
|
945 | +---o 32 mCB-revert-m-0 | |
946 | | |/ |
|
946 | | |/ | |
947 | | o 6 c-1 delete d |
|
947 | | o 6 c-1 delete d | |
948 | | | |
|
948 | | | | |
949 | o | 5 b-1: b update |
|
949 | o | 5 b-1: b update | |
950 | |/ |
|
950 | |/ | |
951 | o 2 i-2: c -move-> d |
|
951 | o 2 i-2: c -move-> d | |
952 | | |
|
952 | | | |
953 | o 1 i-1: a -move-> c |
|
953 | o 1 i-1: a -move-> c | |
954 | | |
|
954 | | | |
955 | o 0 i-0 initial commit: a b h |
|
955 | o 0 i-0 initial commit: a b h | |
956 |
|
956 | |||
957 |
|
957 | |||
958 | BROKEN: 'a' should be the the source of 'd' in the changeset centric algorithm too |
|
958 | BROKEN: 'a' should be the the source of 'd' in the changeset centric algorithm too | |
959 |
|
959 | |||
960 | $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mCB-revert-m-0")' |
|
960 | $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mCB-revert-m-0")' | |
961 | M b |
|
961 | M b | |
962 | A d |
|
962 | A d | |
963 | a (filelog !) |
|
963 | a (filelog !) | |
964 | R a |
|
964 | R a | |
965 | $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBC-revert-m-0")' |
|
965 | $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBC-revert-m-0")' | |
966 | M b |
|
966 | M b | |
967 | A d |
|
967 | A d | |
968 | a (filelog !) |
|
968 | a (filelog !) | |
969 | R a |
|
969 | R a | |
970 | $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mCB-revert-m-0")' |
|
970 | $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mCB-revert-m-0")' | |
971 | M b |
|
971 | M b | |
972 | A d |
|
972 | A d | |
973 | $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mBC-revert-m-0")' |
|
973 | $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mBC-revert-m-0")' | |
974 | M b |
|
974 | M b | |
975 | A d |
|
975 | A d | |
976 | $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mCB-revert-m-0")' |
|
976 | $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mCB-revert-m-0")' | |
977 | $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mBC-revert-m-0")' |
|
977 | $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mBC-revert-m-0")' | |
978 |
|
978 | |||
|
979 | ||||
|
980 | Test that sidedata computations during upgrades ares correct | |||
|
981 | ============================================================ | |||
|
982 | ||||
|
983 | We upgrade a repository that is not using sidedata (the filelog case) and | |||
|
984 | check that the same side data have been generated as if they were computed at | |||
|
985 | commit time. | |||
|
986 | ||||
|
987 | ||||
|
988 | #if filelog | |||
|
989 | $ cat >> $HGRCPATH << EOF | |||
|
990 | > [format] | |||
|
991 | > exp-use-side-data = yes | |||
|
992 | > exp-use-copies-side-data-changeset = yes | |||
|
993 | > EOF | |||
|
994 | $ hg debugformat -v | |||
|
995 | format-variant repo config default | |||
|
996 | fncache: yes yes yes | |||
|
997 | dotencode: yes yes yes | |||
|
998 | generaldelta: yes yes yes | |||
|
999 | sparserevlog: yes yes yes | |||
|
1000 | sidedata: no yes no | |||
|
1001 | persistent-nodemap: no no no | |||
|
1002 | copies-sdc: no yes no | |||
|
1003 | plain-cl-delta: yes yes yes | |||
|
1004 | compression: * (glob) | |||
|
1005 | compression-level: default default default | |||
|
1006 | $ hg debugupgraderepo --run --quiet | |||
|
1007 | upgrade will perform the following actions: | |||
|
1008 | ||||
|
1009 | requirements | |||
|
1010 | preserved: * (glob) | |||
|
1011 | added: exp-copies-sidedata-changeset, exp-sidedata-flag | |||
|
1012 | ||||
|
1013 | #endif | |||
|
1014 | ||||
|
1015 | ||||
|
1016 | #if no-compatibility | |||
|
1017 | ||||
|
1018 | $ for rev in `hg log --rev 'all()' -T '{rev}\n'`; do | |||
|
1019 | > echo "##### revision $rev #####" | |||
|
1020 | > hg debugsidedata -c -v -- $rev | |||
|
1021 | > done | |||
|
1022 | ##### revision 0 ##### | |||
|
1023 | 1 sidedata entries | |||
|
1024 | entry-0014 size 34 | |||
|
1025 | '\x00\x00\x00\x03\x04\x00\x00\x00\x01\x00\x00\x00\x00\x04\x00\x00\x00\x02\x00\x00\x00\x00\x04\x00\x00\x00\x03\x00\x00\x00\x00abh' | |||
|
1026 | ##### revision 1 ##### | |||
|
1027 | 1 sidedata entries | |||
|
1028 | entry-0014 size 24 | |||
|
1029 | '\x00\x00\x00\x02\x0c\x00\x00\x00\x01\x00\x00\x00\x00\x06\x00\x00\x00\x02\x00\x00\x00\x00ac' | |||
|
1030 | ##### revision 2 ##### | |||
|
1031 | 1 sidedata entries | |||
|
1032 | entry-0014 size 24 | |||
|
1033 | '\x00\x00\x00\x02\x0c\x00\x00\x00\x01\x00\x00\x00\x00\x06\x00\x00\x00\x02\x00\x00\x00\x00cd' | |||
|
1034 | ##### revision 3 ##### | |||
|
1035 | 1 sidedata entries | |||
|
1036 | entry-0014 size 24 | |||
|
1037 | '\x00\x00\x00\x02\x0c\x00\x00\x00\x01\x00\x00\x00\x00\x06\x00\x00\x00\x02\x00\x00\x00\x00de' | |||
|
1038 | ##### revision 4 ##### | |||
|
1039 | 1 sidedata entries | |||
|
1040 | entry-0014 size 24 | |||
|
1041 | '\x00\x00\x00\x02\x0c\x00\x00\x00\x01\x00\x00\x00\x00\x06\x00\x00\x00\x02\x00\x00\x00\x00ef' | |||
|
1042 | ##### revision 5 ##### | |||
|
1043 | 1 sidedata entries | |||
|
1044 | entry-0014 size 14 | |||
|
1045 | '\x00\x00\x00\x01\x14\x00\x00\x00\x01\x00\x00\x00\x00b' | |||
|
1046 | ##### revision 6 ##### | |||
|
1047 | 1 sidedata entries | |||
|
1048 | entry-0014 size 14 | |||
|
1049 | '\x00\x00\x00\x01\x0c\x00\x00\x00\x01\x00\x00\x00\x00d' | |||
|
1050 | ##### revision 7 ##### | |||
|
1051 | 1 sidedata entries | |||
|
1052 | entry-0014 size 14 | |||
|
1053 | '\x00\x00\x00\x01\x0c\x00\x00\x00\x01\x00\x00\x00\x00d' | |||
|
1054 | ##### revision 8 ##### | |||
|
1055 | 1 sidedata entries | |||
|
1056 | entry-0014 size 14 | |||
|
1057 | '\x00\x00\x00\x01\x04\x00\x00\x00\x01\x00\x00\x00\x00d' | |||
|
1058 | ##### revision 9 ##### | |||
|
1059 | 1 sidedata entries | |||
|
1060 | entry-0014 size 24 | |||
|
1061 | '\x00\x00\x00\x02\x0c\x00\x00\x00\x01\x00\x00\x00\x00\x06\x00\x00\x00\x02\x00\x00\x00\x00bg' | |||
|
1062 | ##### revision 10 ##### | |||
|
1063 | 1 sidedata entries | |||
|
1064 | entry-0014 size 24 | |||
|
1065 | '\x00\x00\x00\x02\x06\x00\x00\x00\x01\x00\x00\x00\x01\x0c\x00\x00\x00\x02\x00\x00\x00\x00fg' | |||
|
1066 | ##### revision 11 ##### | |||
|
1067 | 1 sidedata entries | |||
|
1068 | entry-0014 size 4 | |||
|
1069 | '\x00\x00\x00\x00' | |||
|
1070 | ##### revision 12 ##### | |||
|
1071 | 1 sidedata entries | |||
|
1072 | entry-0014 size 4 | |||
|
1073 | '\x00\x00\x00\x00' | |||
|
1074 | ##### revision 13 ##### | |||
|
1075 | 1 sidedata entries | |||
|
1076 | entry-0014 size 4 | |||
|
1077 | '\x00\x00\x00\x00' | |||
|
1078 | ##### revision 14 ##### | |||
|
1079 | 1 sidedata entries | |||
|
1080 | entry-0014 size 14 | |||
|
1081 | '\x00\x00\x00\x01\x04\x00\x00\x00\x01\x00\x00\x00\x00d' | |||
|
1082 | ##### revision 15 ##### | |||
|
1083 | 1 sidedata entries | |||
|
1084 | entry-0014 size 4 | |||
|
1085 | '\x00\x00\x00\x00' | |||
|
1086 | ##### revision 16 ##### | |||
|
1087 | 1 sidedata entries | |||
|
1088 | entry-0014 size 14 | |||
|
1089 | '\x00\x00\x00\x01\x04\x00\x00\x00\x01\x00\x00\x00\x00d' | |||
|
1090 | ##### revision 17 ##### | |||
|
1091 | 1 sidedata entries | |||
|
1092 | entry-0014 size 4 | |||
|
1093 | '\x00\x00\x00\x00' | |||
|
1094 | ##### revision 18 ##### | |||
|
1095 | 1 sidedata entries | |||
|
1096 | entry-0014 size 4 | |||
|
1097 | '\x00\x00\x00\x00' | |||
|
1098 | ##### revision 19 ##### | |||
|
1099 | 1 sidedata entries | |||
|
1100 | entry-0014 size 14 | |||
|
1101 | '\x00\x00\x00\x01\x08\x00\x00\x00\x01\x00\x00\x00\x00f' | |||
|
1102 | ##### revision 20 ##### | |||
|
1103 | 1 sidedata entries | |||
|
1104 | entry-0014 size 14 | |||
|
1105 | '\x00\x00\x00\x01\x08\x00\x00\x00\x01\x00\x00\x00\x00f' | |||
|
1106 | ##### revision 21 ##### | |||
|
1107 | 1 sidedata entries | |||
|
1108 | entry-0014 size 24 | |||
|
1109 | '\x00\x00\x00\x02\x0c\x00\x00\x00\x01\x00\x00\x00\x00\x06\x00\x00\x00\x02\x00\x00\x00\x00hi' | |||
|
1110 | ##### revision 22 ##### | |||
|
1111 | 1 sidedata entries | |||
|
1112 | entry-0014 size 24 | |||
|
1113 | '\x00\x00\x00\x02\x16\x00\x00\x00\x01\x00\x00\x00\x01\x0c\x00\x00\x00\x02\x00\x00\x00\x00di' | |||
|
1114 | ##### revision 23 ##### | |||
|
1115 | 1 sidedata entries | |||
|
1116 | entry-0014 size 4 | |||
|
1117 | '\x00\x00\x00\x00' | |||
|
1118 | ##### revision 24 ##### | |||
|
1119 | 1 sidedata entries | |||
|
1120 | entry-0014 size 4 | |||
|
1121 | '\x00\x00\x00\x00' | |||
|
1122 | ##### revision 25 ##### | |||
|
1123 | 1 sidedata entries | |||
|
1124 | entry-0014 size 14 | |||
|
1125 | '\x00\x00\x00\x01\x14\x00\x00\x00\x01\x00\x00\x00\x00d' | |||
|
1126 | ##### revision 26 ##### | |||
|
1127 | 1 sidedata entries | |||
|
1128 | entry-0014 size 14 | |||
|
1129 | '\x00\x00\x00\x01\x08\x00\x00\x00\x01\x00\x00\x00\x00d' | |||
|
1130 | ##### revision 27 ##### | |||
|
1131 | 1 sidedata entries | |||
|
1132 | entry-0014 size 14 | |||
|
1133 | '\x00\x00\x00\x01\x08\x00\x00\x00\x01\x00\x00\x00\x00d' | |||
|
1134 | ##### revision 28 ##### | |||
|
1135 | 1 sidedata entries | |||
|
1136 | entry-0014 size 14 | |||
|
1137 | '\x00\x00\x00\x01\x08\x00\x00\x00\x01\x00\x00\x00\x00d' | |||
|
1138 | ##### revision 29 ##### | |||
|
1139 | 1 sidedata entries | |||
|
1140 | entry-0014 size 14 | |||
|
1141 | '\x00\x00\x00\x01\x08\x00\x00\x00\x01\x00\x00\x00\x00d' | |||
|
1142 | ##### revision 30 ##### | |||
|
1143 | 1 sidedata entries | |||
|
1144 | entry-0014 size 4 | |||
|
1145 | '\x00\x00\x00\x00' | |||
|
1146 | ##### revision 31 ##### | |||
|
1147 | 1 sidedata entries | |||
|
1148 | entry-0014 size 4 | |||
|
1149 | '\x00\x00\x00\x00' | |||
|
1150 | ##### revision 32 ##### | |||
|
1151 | 1 sidedata entries | |||
|
1152 | entry-0014 size 4 | |||
|
1153 | '\x00\x00\x00\x00' | |||
|
1154 | ##### revision 33 ##### | |||
|
1155 | 1 sidedata entries | |||
|
1156 | entry-0014 size 4 | |||
|
1157 | '\x00\x00\x00\x00' | |||
|
1158 | ||||
|
1159 | #endif |
General Comments 0
You need to be logged in to leave comments.
Login now