comparison tests/test-merge-local.t @ 12258:98ec977aa61e

tests: unify test-merge-local
author Adrian Buehlmann <adrian@cadifra.com>
date Sat, 11 Sep 2010 21:19:12 +0200
parents tests/test-merge-local@4c94b6d0fb1c
children 4134686b83e1
comparison
equal deleted inserted replaced
12257:470e0b1ddc6e 12258:98ec977aa61e
1 $ hg init
2
3 Revision 0:
4
5 $ echo "unchanged" > unchanged
6 $ echo "remove me" > remove
7 $ echo "copy me" > copy
8 $ echo "move me" > move
9 $ for i in 1 2 3 4 5 6 7 8 9; do
10 > echo "merge ok $i" >> zzz1_merge_ok
11 > done
12 $ echo "merge bad" > zzz2_merge_bad
13 $ hg ci -Am "revision 0"
14 adding copy
15 adding move
16 adding remove
17 adding unchanged
18 adding zzz1_merge_ok
19 adding zzz2_merge_bad
20
21 Revision 1:
22
23 $ hg rm remove
24 $ hg mv move moved
25 $ hg cp copy copied
26 $ echo "added" > added
27 $ hg add added
28 $ echo "new first line" > zzz1_merge_ok
29 $ hg cat zzz1_merge_ok >> zzz1_merge_ok
30 $ echo "new last line" >> zzz2_merge_bad
31 $ hg ci -m "revision 1"
32
33 Local changes to revision 0:
34
35 $ hg co 0
36 4 files updated, 0 files merged, 3 files removed, 0 files unresolved
37 $ echo "new last line" >> zzz1_merge_ok
38 $ echo "another last line" >> zzz2_merge_bad
39
40 $ hg diff --nodates | grep "^[+-][^<>]"
41 --- a/zzz1_merge_ok
42 +++ b/zzz1_merge_ok
43 +new last line
44 --- a/zzz2_merge_bad
45 +++ b/zzz2_merge_bad
46 +another last line
47
48 $ hg st
49 M zzz1_merge_ok
50 M zzz2_merge_bad
51
52 Local merge with bad merge tool:
53
54 $ HGMERGE=false hg co
55 merging zzz1_merge_ok
56 merging zzz2_merge_bad
57 merging zzz2_merge_bad failed!
58 3 files updated, 1 files merged, 2 files removed, 1 files unresolved
59 use 'hg resolve' to retry unresolved file merges
60
61 $ hg co 0
62 merging zzz1_merge_ok
63 merging zzz2_merge_bad
64 warning: conflicts during merge.
65 merging zzz2_merge_bad failed!
66 2 files updated, 1 files merged, 3 files removed, 1 files unresolved
67 use 'hg resolve' to retry unresolved file merges
68
69 $ hg diff --nodates | grep "^[+-][^<>]"
70 --- a/zzz1_merge_ok
71 +++ b/zzz1_merge_ok
72 +new last line
73 --- a/zzz2_merge_bad
74 +++ b/zzz2_merge_bad
75 +another last line
76 +=======
77
78 $ hg st
79 M zzz1_merge_ok
80 M zzz2_merge_bad
81 ? zzz2_merge_bad.orig
82
83 Local merge with conflicts:
84
85 $ hg co
86 merging zzz1_merge_ok
87 merging zzz2_merge_bad
88 warning: conflicts during merge.
89 merging zzz2_merge_bad failed!
90 3 files updated, 1 files merged, 2 files removed, 1 files unresolved
91 use 'hg resolve' to retry unresolved file merges
92
93 $ hg co 0
94 merging zzz1_merge_ok
95 merging zzz2_merge_bad
96 warning: conflicts during merge.
97 merging zzz2_merge_bad failed!
98 2 files updated, 1 files merged, 3 files removed, 1 files unresolved
99 use 'hg resolve' to retry unresolved file merges
100
101 $ hg diff --nodates | grep "^[+-][^<>]"
102 --- a/zzz1_merge_ok
103 +++ b/zzz1_merge_ok
104 +new last line
105 --- a/zzz2_merge_bad
106 +++ b/zzz2_merge_bad
107 +another last line
108 +=======
109 +=======
110 +new last line
111 +=======
112
113 $ hg st
114 M zzz1_merge_ok
115 M zzz2_merge_bad
116 ? zzz2_merge_bad.orig
117
118 Local merge without conflicts:
119
120 $ hg revert zzz2_merge_bad
121
122 $ hg co
123 merging zzz1_merge_ok
124 4 files updated, 1 files merged, 2 files removed, 0 files unresolved
125
126 $ hg diff --nodates | grep "^[+-][^<>]"
127 --- a/zzz1_merge_ok
128 +++ b/zzz1_merge_ok
129 +new last line
130
131 $ hg st
132 M zzz1_merge_ok
133 ? zzz2_merge_bad.orig
134