Mercurial > hg
comparison tests/test-annotate.t @ 42151:7116fc614cfc
tests: make merge conflicts explicit in `hg annotate` tests
We were using `true` as merge tool. I think it makes the test easier
to understand if we make the conflicts explcit. It also papered over a
conflict that shouldn't have been a conflict (just a bug in copy
tracing). I've marked that "BROKEN".
Differential Revision: https://phab.mercurial-scm.org/D6252
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Sun, 14 Apr 2019 13:46:40 -0700 |
parents | 0e41f40b01cc |
children | 57203e0210f8 |
comparison
equal
deleted
inserted
replaced
42150:770f5f586ae5 | 42151:7116fc614cfc |
---|---|
1 $ HGMERGE=true; export HGMERGE | 1 $ cat >> "$HGRCPATH" << EOF |
2 > [ui] | |
3 > merge = :merge3 | |
4 > EOF | |
2 | 5 |
3 init | 6 init |
4 | 7 |
5 $ hg init repo | 8 $ hg init repo |
6 $ cd repo | 9 $ cd repo |
208 > EOF | 211 > EOF |
209 $ hg ci -mb2.1 -d '2 0' | 212 $ hg ci -mb2.1 -d '2 0' |
210 created new head | 213 created new head |
211 $ hg merge | 214 $ hg merge |
212 merging b | 215 merging b |
213 0 files updated, 1 files merged, 0 files removed, 0 files unresolved | 216 warning: conflicts while merging b! (edit, then use 'hg resolve --mark') |
214 (branch merge, don't forget to commit) | 217 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
218 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon | |
219 [1] | |
220 $ cat b | |
221 a | |
222 a | |
223 a | |
224 <<<<<<< working copy: 5fbdc1152d97 - test: b2.1 | |
225 b4 | |
226 c | |
227 b5 | |
228 ||||||| base | |
229 ======= | |
230 b4 | |
231 b5 | |
232 b6 | |
233 >>>>>>> merge rev: 37ec9f5c3d1f - test: b2 | |
234 $ cat <<EOF > b | |
235 > a | |
236 > a | |
237 > a | |
238 > b4 | |
239 > c | |
240 > b5 | |
241 > EOF | |
242 $ hg resolve --mark -q | |
243 $ rm b.orig | |
215 $ hg ci -mmergeb -d '3 0' | 244 $ hg ci -mmergeb -d '3 0' |
216 | 245 |
217 annotate after merge | 246 annotate after merge |
218 | 247 |
219 $ hg annotate -nf b | 248 $ hg annotate -nf b |
242 > z | 271 > z |
243 > a | 272 > a |
244 > EOF | 273 > EOF |
245 $ hg ci -mc -d '3 0' | 274 $ hg ci -mc -d '3 0' |
246 created new head | 275 created new head |
276 BROKEN: 'a' was copied to 'b' on both sides. We should not get a merge conflict here | |
247 $ hg merge | 277 $ hg merge |
248 merging b | 278 merging b |
249 0 files updated, 1 files merged, 0 files removed, 0 files unresolved | 279 warning: conflicts while merging b! (edit, then use 'hg resolve --mark') |
250 (branch merge, don't forget to commit) | 280 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
251 $ cat <<EOF >> b | 281 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon |
282 [1] | |
283 $ cat b | |
284 <<<<<<< working copy: b80e3e32f75a - test: c | |
285 a | |
286 z | |
287 a | |
288 ||||||| base | |
289 ======= | |
290 a | |
291 a | |
292 a | |
293 b4 | |
294 c | |
295 b5 | |
296 >>>>>>> merge rev: 64afcdf8e29e - test: mergeb | |
297 $ cat <<EOF > b | |
298 > a | |
299 > z | |
300 > a | |
252 > b4 | 301 > b4 |
253 > c | 302 > c |
254 > b5 | 303 > b5 |
255 > EOF | 304 > EOF |
305 $ hg resolve --mark -q | |
306 $ rm b.orig | |
256 $ echo d >> b | 307 $ echo d >> b |
257 $ hg ci -mmerge2 -d '4 0' | 308 $ hg ci -mmerge2 -d '4 0' |
258 | 309 |
259 annotate after rename merge | 310 annotate after rename merge |
260 | 311 |
693 20: baz:4 | 744 20: baz:4 |
694 24: baz:3->3+ | 745 24: baz:3->3+ |
695 27: baz:3+->3- | 746 27: baz:3+->3- |
696 $ hg merge 25 | 747 $ hg merge 25 |
697 merging baz and qux to qux | 748 merging baz and qux to qux |
698 0 files updated, 1 files merged, 0 files removed, 0 files unresolved | 749 warning: conflicts while merging qux! (edit, then use 'hg resolve --mark') |
699 (branch merge, don't forget to commit) | 750 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
751 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon | |
752 [1] | |
753 $ cat qux | |
754 0 | |
755 0 | |
756 1 baz:1 | |
757 2 baz:2 | |
758 <<<<<<< working copy: 863de62655ef - test: baz:3+->3- | |
759 3- baz:3 | |
760 4 baz:4 | |
761 ||||||| base | |
762 3+ baz:3 | |
763 4 baz:4 | |
764 ======= | |
765 3+ baz:3 | |
766 4+ baz:4 | |
767 >>>>>>> merge rev: cb8df70ae185 - test: qux:4->4+ | |
768 5 | |
769 6 | |
770 7 | |
771 $ cat > qux <<EOF | |
772 > 0 | |
773 > 0 | |
774 > 1 baz:1 | |
775 > 2 baz:2 | |
776 > 3- baz:3 | |
777 > 4 baz:4 | |
778 > 5 | |
779 > 6 | |
780 > 7 | |
781 > EOF | |
782 $ hg resolve --mark -q | |
783 $ rm qux.orig | |
700 $ hg ci -m merge | 784 $ hg ci -m merge |
701 $ hg log -T '{rev}: {desc}\n' -r 'followlines(qux, 5:7)' | 785 $ hg log -T '{rev}: {desc}\n' -r 'followlines(qux, 5:7)' |
702 16: baz:0 | 786 16: baz:0 |
703 19: baz:3 | 787 19: baz:3 |
704 20: baz:4 | 788 20: baz:4 |
707 27: baz:3+->3- | 791 27: baz:3+->3- |
708 28: merge | 792 28: merge |
709 $ hg up 25 --quiet | 793 $ hg up 25 --quiet |
710 $ hg merge 27 | 794 $ hg merge 27 |
711 merging qux and baz to qux | 795 merging qux and baz to qux |
712 0 files updated, 1 files merged, 0 files removed, 0 files unresolved | 796 warning: conflicts while merging qux! (edit, then use 'hg resolve --mark') |
713 (branch merge, don't forget to commit) | 797 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
798 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon | |
799 [1] | |
800 $ cat qux | |
801 0 | |
802 0 | |
803 1 baz:1 | |
804 2 baz:2 | |
805 <<<<<<< working copy: cb8df70ae185 - test: qux:4->4+ | |
806 3+ baz:3 | |
807 4+ baz:4 | |
808 ||||||| base | |
809 3+ baz:3 | |
810 4 baz:4 | |
811 ======= | |
812 3- baz:3 | |
813 4 baz:4 | |
814 >>>>>>> merge rev: 863de62655ef - test: baz:3+->3- | |
815 5 | |
816 6 | |
817 7 | |
818 $ cat > qux <<EOF | |
819 > 0 | |
820 > 0 | |
821 > 1 baz:1 | |
822 > 2 baz:2 | |
823 > 3+ baz:3 | |
824 > 4+ baz:4 | |
825 > 5 | |
826 > 6 | |
827 > EOF | |
828 $ hg resolve --mark -q | |
829 $ rm qux.orig | |
714 $ hg ci -m 'merge from other side' | 830 $ hg ci -m 'merge from other side' |
715 created new head | 831 created new head |
716 $ hg log -T '{rev}: {desc}\n' -r 'followlines(qux, 5:7)' | 832 $ hg log -T '{rev}: {desc}\n' -r 'followlines(qux, 5:7)' |
717 16: baz:0 | 833 16: baz:0 |
718 19: baz:3 | 834 19: baz:3 |
1059 $ hg commit -m a | 1175 $ hg commit -m a |
1060 $ hg update '.^' -q | 1176 $ hg update '.^' -q |
1061 $ echo 3 >> a | 1177 $ echo 3 >> a |
1062 $ hg commit -m 3 -q | 1178 $ hg commit -m 3 -q |
1063 $ hg merge 2 -q | 1179 $ hg merge 2 -q |
1180 warning: conflicts while merging a! (edit, then use 'hg resolve --mark') | |
1181 [1] | |
1182 $ cat a | |
1183 <<<<<<< working copy: 0a068f0261cf - test: 3 | |
1184 1 | |
1185 2 | |
1186 3 | |
1187 ||||||| base | |
1188 1 | |
1189 2 | |
1190 ======= | |
1191 a | |
1192 >>>>>>> merge rev: 9409851bc20a - test: a | |
1064 $ cat > a << EOF | 1193 $ cat > a << EOF |
1065 > b | 1194 > b |
1066 > 1 | 1195 > 1 |
1067 > 2 | 1196 > 2 |
1068 > 3 | 1197 > 3 |
1069 > a | 1198 > a |
1070 > EOF | 1199 > EOF |
1071 $ hg resolve --mark -q | 1200 $ hg resolve --mark -q |
1201 $ rm a.orig | |
1072 $ hg commit -m m | 1202 $ hg commit -m m |
1073 $ hg annotate a | 1203 $ hg annotate a |
1074 4: b | 1204 4: b |
1075 0: 1 | 1205 0: 1 |
1076 1: 2 | 1206 1: 2 |