Mercurial > hg
comparison tests/test-copies-chain-merge.t @ 44677:4e2845d9452d
tests: collect all branch creation in one place in test-copies-chain-merge.t
I found this test case really hard to read because it requires
scrolling back and forth between the setup and the verification. The
next patch will move the verification close to the merge commits they
test. This patch prepares for that by moving all branch creation first
so they are separate from the merge commits (because many merge
commits reuse the same branches).
Differential Revision: https://phab.mercurial-scm.org/D8376
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Thu, 02 Apr 2020 13:45:10 -0700 |
parents | 25d97090c6ca |
children | 806f1f1ba430 |
comparison
equal
deleted
inserted
replaced
44676:1756f75873bf | 44677:4e2845d9452d |
---|---|
73 o 1 i-1: a -move-> c | 73 o 1 i-1: a -move-> c |
74 | | 74 | |
75 o 0 i-0 initial commit: a b h | 75 o 0 i-0 initial commit: a b h |
76 | 76 |
77 | 77 |
78 Create a branch that delete a file previous renamed | |
79 | |
80 $ hg up 'desc("i-2")' | |
81 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
82 $ hg rm d | |
83 $ hg ci -m 'c-1 delete d' | |
84 created new head | |
85 $ hg log -G --rev '::.' | |
86 @ 6 c-1 delete d | |
87 | | |
88 o 2 i-2: c -move-> d | |
89 | | |
90 o 1 i-1: a -move-> c | |
91 | | |
92 o 0 i-0 initial commit: a b h | |
93 | |
94 | |
95 Create a branch that delete a file previous renamed and recreate it | |
96 | |
97 $ hg up 'desc("i-2")' | |
98 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
99 $ hg rm d | |
100 $ hg ci -m 'd-1 delete d' | |
101 created new head | |
102 $ echo bar > d | |
103 $ hg add d | |
104 $ hg ci -m 'd-2 re-add d' | |
105 $ hg log -G --rev '::.' | |
106 @ 8 d-2 re-add d | |
107 | | |
108 o 7 d-1 delete d | |
109 | | |
110 o 2 i-2: c -move-> d | |
111 | | |
112 o 1 i-1: a -move-> c | |
113 | | |
114 o 0 i-0 initial commit: a b h | |
115 | |
116 | |
117 Having another branch renaming a different file to the same filename as another | |
118 | |
119 $ hg up 'desc("i-2")' | |
120 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
121 $ hg mv b g | |
122 $ hg ci -m 'e-1 b -move-> g' | |
123 created new head | |
124 $ hg mv g f | |
125 $ hg ci -m 'e-2 g -move-> f' | |
126 $ hg log -G --rev '::.' | |
127 @ 10 e-2 g -move-> f | |
128 | | |
129 o 9 e-1 b -move-> g | |
130 | | |
131 o 2 i-2: c -move-> d | |
132 | | |
133 o 1 i-1: a -move-> c | |
134 | | |
135 o 0 i-0 initial commit: a b h | |
136 | |
78 | 137 |
79 Merge the two branches we just defined (in both directions) | 138 Merge the two branches we just defined (in both directions) |
80 - one with change to an unrelated file | 139 - one with change to an unrelated file |
81 - one with renames in them | 140 - one with renames in them |
82 | 141 |
83 $ hg up 'desc("b-1")' | 142 $ hg up 'desc("b-1")' |
84 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | 143 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
85 $ hg merge 'desc("a-2")' | 144 $ hg merge 'desc("a-2")' |
86 1 files updated, 0 files merged, 1 files removed, 0 files unresolved | 145 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
87 (branch merge, don't forget to commit) | 146 (branch merge, don't forget to commit) |
88 $ hg ci -m 'mBAm-0 simple merge - one way' | 147 $ hg ci -m 'mBAm-0 simple merge - one way' |
89 $ hg up 'desc("a-2")' | 148 $ hg up 'desc("a-2")' |
92 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | 151 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
93 (branch merge, don't forget to commit) | 152 (branch merge, don't forget to commit) |
94 $ hg ci -m 'mABm-0 simple merge - the other way' | 153 $ hg ci -m 'mABm-0 simple merge - the other way' |
95 created new head | 154 created new head |
96 $ hg log -G --rev '::(desc("mABm")+desc("mBAm"))' | 155 $ hg log -G --rev '::(desc("mABm")+desc("mBAm"))' |
97 @ 7 mABm-0 simple merge - the other way | 156 @ 12 mABm-0 simple merge - the other way |
98 |\ | 157 |\ |
99 +---o 6 mBAm-0 simple merge - one way | 158 +---o 11 mBAm-0 simple merge - one way |
100 | |/ | 159 | |/ |
101 | o 5 b-1: b update | 160 | o 5 b-1: b update |
102 | | | 161 | | |
103 o | 4 a-2: e -move-> f | 162 o | 4 a-2: e -move-> f |
104 | | | 163 | | |
105 o | 3 a-1: d -move-> e | 164 o | 3 a-1: d -move-> e |
106 |/ | 165 |/ |
107 o 2 i-2: c -move-> d | |
108 | | |
109 o 1 i-1: a -move-> c | |
110 | | |
111 o 0 i-0 initial commit: a b h | |
112 | |
113 | |
114 Create a branch that delete a file previous renamed | |
115 | |
116 $ hg up 'desc("i-2")' | |
117 2 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
118 $ hg rm d | |
119 $ hg ci -m 'c-1 delete d' | |
120 created new head | |
121 $ hg log -G --rev '::.' | |
122 @ 8 c-1 delete d | |
123 | | |
124 o 2 i-2: c -move-> d | 166 o 2 i-2: c -move-> d |
125 | | 167 | |
126 o 1 i-1: a -move-> c | 168 o 1 i-1: a -move-> c |
127 | | 169 | |
128 o 0 i-0 initial commit: a b h | 170 o 0 i-0 initial commit: a b h |
132 - one with change to an unrelated file | 174 - one with change to an unrelated file |
133 - one deleting the change | 175 - one deleting the change |
134 and recreate an unrelated file after the merge | 176 and recreate an unrelated file after the merge |
135 | 177 |
136 $ hg up 'desc("b-1")' | 178 $ hg up 'desc("b-1")' |
137 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | 179 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
138 $ hg merge 'desc("c-1")' | 180 $ hg merge 'desc("c-1")' |
139 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | 181 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
140 (branch merge, don't forget to commit) | 182 (branch merge, don't forget to commit) |
141 $ hg ci -m 'mBCm-0 simple merge - one way' | 183 $ hg ci -m 'mBCm-0 simple merge - one way' |
142 $ echo bar > d | 184 $ echo bar > d |
151 created new head | 193 created new head |
152 $ echo bar > d | 194 $ echo bar > d |
153 $ hg add d | 195 $ hg add d |
154 $ hg ci -m 'mCBm-1 re-add d' | 196 $ hg ci -m 'mCBm-1 re-add d' |
155 $ hg log -G --rev '::(desc("mCBm")+desc("mBCm"))' | 197 $ hg log -G --rev '::(desc("mCBm")+desc("mBCm"))' |
156 @ 12 mCBm-1 re-add d | 198 @ 16 mCBm-1 re-add d |
157 | | 199 | |
158 o 11 mCBm-0 simple merge - the other way | 200 o 15 mCBm-0 simple merge - the other way |
159 |\ | 201 |\ |
160 | | o 10 mBCm-1 re-add d | 202 | | o 14 mBCm-1 re-add d |
161 | | | | 203 | | | |
162 +---o 9 mBCm-0 simple merge - one way | 204 +---o 13 mBCm-0 simple merge - one way |
163 | |/ | 205 | |/ |
164 | o 8 c-1 delete d | 206 | o 6 c-1 delete d |
165 | | | 207 | | |
166 o | 5 b-1: b update | 208 o | 5 b-1: b update |
167 |/ | 209 |/ |
168 o 2 i-2: c -move-> d | |
169 | | |
170 o 1 i-1: a -move-> c | |
171 | | |
172 o 0 i-0 initial commit: a b h | |
173 | |
174 | |
175 Create a branch that delete a file previous renamed and recreate it | |
176 | |
177 $ hg up 'desc("i-2")' | |
178 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
179 $ hg rm d | |
180 $ hg ci -m 'd-1 delete d' | |
181 created new head | |
182 $ echo bar > d | |
183 $ hg add d | |
184 $ hg ci -m 'd-2 re-add d' | |
185 $ hg log -G --rev '::.' | |
186 @ 14 d-2 re-add d | |
187 | | |
188 o 13 d-1 delete d | |
189 | | |
190 o 2 i-2: c -move-> d | 210 o 2 i-2: c -move-> d |
191 | | 211 | |
192 o 1 i-1: a -move-> c | 212 o 1 i-1: a -move-> c |
193 | | 213 | |
194 o 0 i-0 initial commit: a b h | 214 o 0 i-0 initial commit: a b h |
204 | renamed from c)". | 224 | renamed from c)". |
205 | | 225 | |
206 | The current code arbitrarily pick one side | 226 | The current code arbitrarily pick one side |
207 | 227 |
208 $ hg up 'desc("b-1")' | 228 $ hg up 'desc("b-1")' |
209 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | 229 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
210 $ hg merge 'desc("d-2")' | 230 $ hg merge 'desc("d-2")' |
211 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | 231 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
212 (branch merge, don't forget to commit) | 232 (branch merge, don't forget to commit) |
213 $ hg ci -m 'mBDm-0 simple merge - one way' | 233 $ hg ci -m 'mBDm-0 simple merge - one way' |
214 $ hg up 'desc("d-2")' | 234 $ hg up 'desc("d-2")' |
217 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | 237 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
218 (branch merge, don't forget to commit) | 238 (branch merge, don't forget to commit) |
219 $ hg ci -m 'mDBm-0 simple merge - the other way' | 239 $ hg ci -m 'mDBm-0 simple merge - the other way' |
220 created new head | 240 created new head |
221 $ hg log -G --rev '::(desc("mDBm")+desc("mBDm"))' | 241 $ hg log -G --rev '::(desc("mDBm")+desc("mBDm"))' |
222 @ 16 mDBm-0 simple merge - the other way | 242 @ 18 mDBm-0 simple merge - the other way |
223 |\ | 243 |\ |
224 +---o 15 mBDm-0 simple merge - one way | 244 +---o 17 mBDm-0 simple merge - one way |
225 | |/ | 245 | |/ |
226 | o 14 d-2 re-add d | 246 | o 8 d-2 re-add d |
227 | | | 247 | | |
228 | o 13 d-1 delete d | 248 | o 7 d-1 delete d |
229 | | | 249 | | |
230 o | 5 b-1: b update | 250 o | 5 b-1: b update |
231 |/ | 251 |/ |
232 o 2 i-2: c -move-> d | |
233 | | |
234 o 1 i-1: a -move-> c | |
235 | | |
236 o 0 i-0 initial commit: a b h | |
237 | |
238 | |
239 Having another branch renaming a different file to the same filename as another | |
240 | |
241 $ hg up 'desc("i-2")' | |
242 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
243 $ hg mv b g | |
244 $ hg ci -m 'e-1 b -move-> g' | |
245 created new head | |
246 $ hg mv g f | |
247 $ hg ci -m 'e-2 g -move-> f' | |
248 $ hg log -G --rev '::.' | |
249 @ 18 e-2 g -move-> f | |
250 | | |
251 o 17 e-1 b -move-> g | |
252 | | |
253 o 2 i-2: c -move-> d | 252 o 2 i-2: c -move-> d |
254 | | 253 | |
255 o 1 i-1: a -move-> c | 254 o 1 i-1: a -move-> c |
256 | | 255 | |
257 o 0 i-0 initial commit: a b h | 256 o 0 i-0 initial commit: a b h |
277 $ hg log -G --rev '::(desc("mAEm")+desc("mEAm"))' | 276 $ hg log -G --rev '::(desc("mAEm")+desc("mEAm"))' |
278 @ 20 mEAm-0 simple merge - the other way | 277 @ 20 mEAm-0 simple merge - the other way |
279 |\ | 278 |\ |
280 +---o 19 mAEm-0 simple merge - one way | 279 +---o 19 mAEm-0 simple merge - one way |
281 | |/ | 280 | |/ |
282 | o 18 e-2 g -move-> f | 281 | o 10 e-2 g -move-> f |
283 | | | 282 | | |
284 | o 17 e-1 b -move-> g | 283 | o 9 e-1 b -move-> g |
285 | | | 284 | | |
286 o | 4 a-2: e -move-> f | 285 o | 4 a-2: e -move-> f |
287 | | | 286 | | |
288 o | 3 a-1: d -move-> e | 287 o | 3 a-1: d -move-> e |
289 |/ | 288 |/ |
311 $ hg mv --force i d | 310 $ hg mv --force i d |
312 $ hg commit -m "f-2: rename i -> d" | 311 $ hg commit -m "f-2: rename i -> d" |
313 $ hg debugindex d | 312 $ hg debugindex d |
314 rev linkrev nodeid p1 p2 | 313 rev linkrev nodeid p1 p2 |
315 0 2 01c2f5eabdc4 000000000000 000000000000 | 314 0 2 01c2f5eabdc4 000000000000 000000000000 |
316 1 10 b004912a8510 000000000000 000000000000 | 315 1 8 b004912a8510 000000000000 000000000000 |
317 2 15 0bb5445dc4d0 01c2f5eabdc4 b004912a8510 | 316 2 17 0bb5445dc4d0 01c2f5eabdc4 b004912a8510 |
318 3 22 c72365ee036f 000000000000 000000000000 | 317 3 22 c72365ee036f 000000000000 000000000000 |
319 $ hg up 'desc("b-1")' | 318 $ hg up 'desc("b-1")' |
320 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | 319 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
321 $ hg merge 'desc("f-2")' | 320 $ hg merge 'desc("f-2")' |
322 1 files updated, 0 files merged, 1 files removed, 0 files unresolved | 321 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
376 |\ | 375 |\ |
377 +---o 26 mDGm-0 simple merge - one way | 376 +---o 26 mDGm-0 simple merge - one way |
378 | |/ | 377 | |/ |
379 | o 25 g-1: update d | 378 | o 25 g-1: update d |
380 | | | 379 | | |
381 o | 14 d-2 re-add d | 380 o | 8 d-2 re-add d |
382 | | | 381 | | |
383 o | 13 d-1 delete d | 382 o | 7 d-1 delete d |
384 |/ | 383 |/ |
385 o 2 i-2: c -move-> d | 384 o 2 i-2: c -move-> d |
386 | | 385 | |
387 o 1 i-1: a -move-> c | 386 o 1 i-1: a -move-> c |
388 | | 387 | |
574 $ hg manifest --debug --rev 'desc("b-1")' | grep '644 d' | 573 $ hg manifest --debug --rev 'desc("b-1")' | grep '644 d' |
575 01c2f5eabdc4ce2bdee42b5f86311955e6c8f573 644 d | 574 01c2f5eabdc4ce2bdee42b5f86311955e6c8f573 644 d |
576 $ hg debugindex d | 575 $ hg debugindex d |
577 rev linkrev nodeid p1 p2 | 576 rev linkrev nodeid p1 p2 |
578 0 2 01c2f5eabdc4 000000000000 000000000000 | 577 0 2 01c2f5eabdc4 000000000000 000000000000 |
579 1 10 b004912a8510 000000000000 000000000000 | 578 1 8 b004912a8510 000000000000 000000000000 |
580 2 15 0bb5445dc4d0 01c2f5eabdc4 b004912a8510 | 579 2 17 0bb5445dc4d0 01c2f5eabdc4 b004912a8510 |
581 3 22 c72365ee036f 000000000000 000000000000 | 580 3 22 c72365ee036f 000000000000 000000000000 |
582 4 23 863d9bc49190 01c2f5eabdc4 c72365ee036f | 581 4 23 863d9bc49190 01c2f5eabdc4 c72365ee036f |
583 5 25 7bded9d9da1f 01c2f5eabdc4 000000000000 | 582 5 25 7bded9d9da1f 01c2f5eabdc4 000000000000 |
584 6 26 f04cac32d703 b004912a8510 7bded9d9da1f | 583 6 26 f04cac32d703 b004912a8510 7bded9d9da1f |
585 7 27 d7a5eafb9322 7bded9d9da1f b004912a8510 | 584 7 27 d7a5eafb9322 7bded9d9da1f b004912a8510 |
586 8 28 2ed7a51aed47 c72365ee036f 7bded9d9da1f | 585 8 28 2ed7a51aed47 c72365ee036f 7bded9d9da1f |
587 | 586 |
588 (This `hg log` output if wrong, since no merge actually happened). | 587 (This `hg log` output if wrong, since no merge actually happened). |
589 | 588 |
590 $ hg log -Gfr 'desc("mBDm-0")' d | 589 $ hg log -Gfr 'desc("mBDm-0")' d |
591 o 15 mBDm-0 simple merge - one way | 590 o 17 mBDm-0 simple merge - one way |
592 |\ | 591 |\ |
593 o : 14 d-2 re-add d | 592 o : 8 d-2 re-add d |
594 :/ | 593 :/ |
595 o 2 i-2: c -move-> d | 594 o 2 i-2: c -move-> d |
596 | | 595 | |
597 o 1 i-1: a -move-> c | 596 o 1 i-1: a -move-> c |
598 | | 597 | |
600 | 599 |
601 | 600 |
602 This `hg log` output is correct | 601 This `hg log` output is correct |
603 | 602 |
604 $ hg log -Gfr 'desc("mDBm-0")' d | 603 $ hg log -Gfr 'desc("mDBm-0")' d |
605 o 14 d-2 re-add d | 604 o 8 d-2 re-add d |
606 | | 605 | |
607 ~ | 606 ~ |
608 | 607 |
609 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBDm-0")' | 608 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBDm-0")' |
610 M b | 609 M b |
631 $ hg manifest --debug --rev 'desc("e-2")' | grep '644 f' | 630 $ hg manifest --debug --rev 'desc("e-2")' | grep '644 f' |
632 6da5a2eecb9c833f830b67a4972366d49a9a142c 644 f | 631 6da5a2eecb9c833f830b67a4972366d49a9a142c 644 f |
633 $ hg debugindex f | 632 $ hg debugindex f |
634 rev linkrev nodeid p1 p2 | 633 rev linkrev nodeid p1 p2 |
635 0 4 0dd616bc7ab1 000000000000 000000000000 | 634 0 4 0dd616bc7ab1 000000000000 000000000000 |
636 1 18 6da5a2eecb9c 000000000000 000000000000 | 635 1 10 6da5a2eecb9c 000000000000 000000000000 |
637 2 19 eb806e34ef6b 0dd616bc7ab1 6da5a2eecb9c | 636 2 19 eb806e34ef6b 0dd616bc7ab1 6da5a2eecb9c |
638 $ hg status --copies --rev 'desc("a-2")' --rev 'desc("mAEm-0")' | 637 $ hg status --copies --rev 'desc("a-2")' --rev 'desc("mAEm-0")' |
639 M f | 638 M f |
640 R b | 639 R b |
641 $ hg status --copies --rev 'desc("a-2")' --rev 'desc("mEAm-0")' | 640 $ hg status --copies --rev 'desc("a-2")' --rev 'desc("mEAm-0")' |
768 $ hg log -Gfr 'desc("mDGm-0")' d | 767 $ hg log -Gfr 'desc("mDGm-0")' d |
769 o 26 mDGm-0 simple merge - one way | 768 o 26 mDGm-0 simple merge - one way |
770 |\ | 769 |\ |
771 | o 25 g-1: update d | 770 | o 25 g-1: update d |
772 | | | 771 | | |
773 o | 14 d-2 re-add d | 772 o | 8 d-2 re-add d |
774 |/ | 773 |/ |
775 o 2 i-2: c -move-> d | 774 o 2 i-2: c -move-> d |
776 | | 775 | |
777 o 1 i-1: a -move-> c | 776 o 1 i-1: a -move-> c |
778 | | 777 | |
783 $ hg log -Gfr 'desc("mDGm-0")' d | 782 $ hg log -Gfr 'desc("mDGm-0")' d |
784 o 26 mDGm-0 simple merge - one way | 783 o 26 mDGm-0 simple merge - one way |
785 |\ | 784 |\ |
786 | o 25 g-1: update d | 785 | o 25 g-1: update d |
787 | | | 786 | | |
788 o | 14 d-2 re-add d | 787 o | 8 d-2 re-add d |
789 |/ | 788 |/ |
790 o 2 i-2: c -move-> d | 789 o 2 i-2: c -move-> d |
791 | | 790 | |
792 o 1 i-1: a -move-> c | 791 o 1 i-1: a -move-> c |
793 | | 792 | |