##// END OF EJS Templates
test-merge-changedelete.t: add a file with regular merge conflicts...
Siddharth Agarwal -
r27125:969ca40c default
parent child Browse files
Show More
@@ -1,175 +1,220 b''
1 1 Test for
2 2 b5605d88dc27: Make ui.prompt repeat on "unrecognized response" again
3 3 (issue897)
4 4
5 5 840e2b315c1f: Fix misleading error and prompts during update/merge
6 6 (issue556)
7 7
8 8 Make sure HGMERGE doesn't interfere with the test
9 9 $ unset HGMERGE
10 10
11 11 $ status() {
12 12 > echo "--- status ---"
13 > hg st -A file1 file2
14 > for file in file1 file2; do
13 > hg st -A file1 file2 file3
14 > for file in file1 file2 file3; do
15 15 > if [ -f $file ]; then
16 16 > echo "--- $file ---"
17 17 > cat $file
18 18 > else
19 19 > echo "*** $file does not exist"
20 20 > fi
21 21 > done
22 22 > }
23 23
24 24 $ hg init
25 25
26 26 $ echo 1 > file1
27 27 $ echo 2 > file2
28 $ hg ci -Am 'added file1 and file2'
28 $ echo 3 > file3
29 $ hg ci -Am 'added files'
29 30 adding file1
30 31 adding file2
32 adding file3
31 33
32 34 $ hg rm file1
33 35 $ echo changed >> file2
34 $ hg ci -m 'removed file1, changed file2'
36 $ echo changed1 >> file3
37 $ hg ci -m 'removed file1, changed file2, changed file3'
35 38
36 39 $ hg co 0
37 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
40 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
38 41
39 42 $ echo changed >> file1
40 43 $ hg rm file2
41 $ hg ci -m 'changed file1, removed file2'
44 $ echo changed2 >> file3
45 $ hg ci -m 'changed file1, removed file2, changed file3'
42 46 created new head
43 47
44 48
45 49 Non-interactive merge:
46 50
47 51 $ hg merge -y
48 52 local changed file1 which remote deleted
49 53 use (c)hanged version or (d)elete? c
50 54 remote changed file2 which local deleted
51 55 use (c)hanged version or leave (d)eleted? c
52 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
53 (branch merge, don't forget to commit)
56 merging file3
57 warning: conflicts while merging file3! (edit, then use 'hg resolve --mark')
58 1 files updated, 0 files merged, 0 files removed, 1 files unresolved
59 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
60 [1]
54 61
55 62 $ status
56 63 --- status ---
57 64 M file2
65 M file3
58 66 C file1
59 67 --- file1 ---
60 68 1
61 69 changed
62 70 --- file2 ---
63 71 2
64 72 changed
73 --- file3 ---
74 3
75 <<<<<<< local: 13910f48cf7b - test: changed file1, removed file2, changed file3
76 changed2
77 =======
78 changed1
79 >>>>>>> other: 10f9a0a634e8 - test: removed file1, changed file2, changed file3
65 80
66 81
67 82 Interactive merge:
68 83
69 84 $ hg co -C
70 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
85 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
71 86
72 87 $ hg merge --config ui.interactive=true <<EOF
73 88 > c
74 89 > d
75 90 > EOF
76 91 local changed file1 which remote deleted
77 92 use (c)hanged version or (d)elete? c
78 93 remote changed file2 which local deleted
79 94 use (c)hanged version or leave (d)eleted? d
80 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
81 (branch merge, don't forget to commit)
95 merging file3
96 warning: conflicts while merging file3! (edit, then use 'hg resolve --mark')
97 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
98 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
99 [1]
82 100
83 101 $ status
84 102 --- status ---
85 103 file2: * (glob)
104 M file3
86 105 C file1
87 106 --- file1 ---
88 107 1
89 108 changed
90 109 *** file2 does not exist
110 --- file3 ---
111 3
112 <<<<<<< local: 13910f48cf7b - test: changed file1, removed file2, changed file3
113 changed2
114 =======
115 changed1
116 >>>>>>> other: 10f9a0a634e8 - test: removed file1, changed file2, changed file3
91 117
92 118
93 119 Interactive merge with bad input:
94 120
95 121 $ hg co -C
96 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
122 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
97 123
98 124 $ hg merge --config ui.interactive=true <<EOF
99 125 > foo
100 126 > bar
101 127 > d
102 128 > baz
103 129 > c
104 130 > EOF
105 131 local changed file1 which remote deleted
106 132 use (c)hanged version or (d)elete? foo
107 133 unrecognized response
108 134 local changed file1 which remote deleted
109 135 use (c)hanged version or (d)elete? bar
110 136 unrecognized response
111 137 local changed file1 which remote deleted
112 138 use (c)hanged version or (d)elete? d
113 139 remote changed file2 which local deleted
114 140 use (c)hanged version or leave (d)eleted? baz
115 141 unrecognized response
116 142 remote changed file2 which local deleted
117 143 use (c)hanged version or leave (d)eleted? c
118 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
119 (branch merge, don't forget to commit)
144 merging file3
145 warning: conflicts while merging file3! (edit, then use 'hg resolve --mark')
146 1 files updated, 0 files merged, 1 files removed, 1 files unresolved
147 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
148 [1]
120 149
121 150 $ status
122 151 --- status ---
123 152 M file2
153 M file3
124 154 R file1
125 155 *** file1 does not exist
126 156 --- file2 ---
127 157 2
128 158 changed
159 --- file3 ---
160 3
161 <<<<<<< local: 13910f48cf7b - test: changed file1, removed file2, changed file3
162 changed2
163 =======
164 changed1
165 >>>>>>> other: 10f9a0a634e8 - test: removed file1, changed file2, changed file3
129 166
130 167
131 168 Interactive merge with not enough input:
132 169
133 170 $ hg co -C
134 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
171 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
135 172
136 173 $ hg merge --config ui.interactive=true <<EOF
137 174 > d
138 175 > EOF
139 176 local changed file1 which remote deleted
140 177 use (c)hanged version or (d)elete? d
141 178 remote changed file2 which local deleted
142 179 use (c)hanged version or leave (d)eleted? abort: response expected
143 180 [255]
144 181
145 182 $ status
146 183 --- status ---
147 184 file2: * (glob)
148 185 C file1
186 C file3
149 187 --- file1 ---
150 188 1
151 189 changed
152 190 *** file2 does not exist
191 --- file3 ---
192 3
193 changed2
153 194
154 195 Non-interactive linear update
155 196
156 197 $ hg co -C 0
157 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
198 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
158 199 $ echo changed >> file1
159 200 $ hg rm file2
160 201 $ hg update 1 -y
161 202 local changed file1 which remote deleted
162 203 use (c)hanged version or (d)elete? c
163 204 remote changed file2 which local deleted
164 205 use (c)hanged version or leave (d)eleted? c
165 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
206 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
166 207 $ status
167 208 --- status ---
168 209 A file1
169 210 C file2
211 C file3
170 212 --- file1 ---
171 213 1
172 214 changed
173 215 --- file2 ---
174 216 2
175 217 changed
218 --- file3 ---
219 3
220 changed1
General Comments 0
You need to be logged in to leave comments. Login now