Show More
@@ -1,230 +1,260 | |||
|
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 | 13 | > hg st -A file1 file2 file3 |
|
14 | 14 | > echo "--- resolve --list ---" |
|
15 | 15 | > hg resolve --list file1 file2 file3 |
|
16 | > echo "--- debugmergestate ---" | |
|
17 | > hg debugmergestate | |
|
16 | 18 | > for file in file1 file2 file3; do |
|
17 | 19 | > if [ -f $file ]; then |
|
18 | 20 | > echo "--- $file ---" |
|
19 | 21 | > cat $file |
|
20 | 22 | > else |
|
21 | 23 | > echo "*** $file does not exist" |
|
22 | 24 | > fi |
|
23 | 25 | > done |
|
24 | 26 | > } |
|
25 | 27 | |
|
26 | 28 | $ hg init |
|
27 | 29 | |
|
28 | 30 | $ echo 1 > file1 |
|
29 | 31 | $ echo 2 > file2 |
|
30 | 32 | $ echo 3 > file3 |
|
31 | 33 | $ hg ci -Am 'added files' |
|
32 | 34 | adding file1 |
|
33 | 35 | adding file2 |
|
34 | 36 | adding file3 |
|
35 | 37 | |
|
36 | 38 | $ hg rm file1 |
|
37 | 39 | $ echo changed >> file2 |
|
38 | 40 | $ echo changed1 >> file3 |
|
39 | 41 | $ hg ci -m 'removed file1, changed file2, changed file3' |
|
40 | 42 | |
|
41 | 43 | $ hg co 0 |
|
42 | 44 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
43 | 45 | |
|
44 | 46 | $ echo changed >> file1 |
|
45 | 47 | $ hg rm file2 |
|
46 | 48 | $ echo changed2 >> file3 |
|
47 | 49 | $ hg ci -m 'changed file1, removed file2, changed file3' |
|
48 | 50 | created new head |
|
49 | 51 | |
|
50 | 52 | |
|
51 | 53 | Non-interactive merge: |
|
52 | 54 | |
|
53 | 55 | $ hg merge -y |
|
54 | 56 | local changed file1 which remote deleted |
|
55 | 57 | use (c)hanged version or (d)elete? c |
|
56 | 58 | remote changed file2 which local deleted |
|
57 | 59 | use (c)hanged version or leave (d)eleted? c |
|
58 | 60 | merging file3 |
|
59 | 61 | warning: conflicts while merging file3! (edit, then use 'hg resolve --mark') |
|
60 | 62 | 1 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
61 | 63 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon |
|
62 | 64 | [1] |
|
63 | 65 | |
|
64 | 66 | $ status |
|
65 | 67 | --- status --- |
|
66 | 68 | M file2 |
|
67 | 69 | M file3 |
|
68 | 70 | C file1 |
|
69 | 71 | --- resolve --list --- |
|
70 | 72 | U file3 |
|
73 | --- debugmergestate --- | |
|
74 | * version 2 records | |
|
75 | local: 13910f48cf7bdb2a0ba6e24b4900e4fdd5739dd4 | |
|
76 | other: 10f9a0a634e82080907e62f075ab119cbc565ea6 | |
|
77 | file: file3 (record type "F", state "u", hash d5b0a58bc47161b1b8a831084b366f757c4f0b11) | |
|
78 | local path: file3 (flags "") | |
|
79 | ancestor path: file3 (node 2661d26c649684b482d10f91960cc3db683c38b4) | |
|
80 | other path: file3 (node a2644c43e210356772c7772a8674544a62e06beb) | |
|
71 | 81 | --- file1 --- |
|
72 | 82 | 1 |
|
73 | 83 | changed |
|
74 | 84 | --- file2 --- |
|
75 | 85 | 2 |
|
76 | 86 | changed |
|
77 | 87 | --- file3 --- |
|
78 | 88 | 3 |
|
79 | 89 | <<<<<<< local: 13910f48cf7b - test: changed file1, removed file2, changed file3 |
|
80 | 90 | changed2 |
|
81 | 91 | ======= |
|
82 | 92 | changed1 |
|
83 | 93 | >>>>>>> other: 10f9a0a634e8 - test: removed file1, changed file2, changed file3 |
|
84 | 94 | |
|
85 | 95 | |
|
86 | 96 | Interactive merge: |
|
87 | 97 | |
|
88 | 98 | $ hg co -C |
|
89 | 99 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
90 | 100 | |
|
91 | 101 | $ hg merge --config ui.interactive=true <<EOF |
|
92 | 102 | > c |
|
93 | 103 | > d |
|
94 | 104 | > EOF |
|
95 | 105 | local changed file1 which remote deleted |
|
96 | 106 | use (c)hanged version or (d)elete? c |
|
97 | 107 | remote changed file2 which local deleted |
|
98 | 108 | use (c)hanged version or leave (d)eleted? d |
|
99 | 109 | merging file3 |
|
100 | 110 | warning: conflicts while merging file3! (edit, then use 'hg resolve --mark') |
|
101 | 111 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
102 | 112 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon |
|
103 | 113 | [1] |
|
104 | 114 | |
|
105 | 115 | $ status |
|
106 | 116 | --- status --- |
|
107 | 117 | file2: * (glob) |
|
108 | 118 | M file3 |
|
109 | 119 | C file1 |
|
110 | 120 | --- resolve --list --- |
|
111 | 121 | U file3 |
|
122 | --- debugmergestate --- | |
|
123 | * version 2 records | |
|
124 | local: 13910f48cf7bdb2a0ba6e24b4900e4fdd5739dd4 | |
|
125 | other: 10f9a0a634e82080907e62f075ab119cbc565ea6 | |
|
126 | file: file3 (record type "F", state "u", hash d5b0a58bc47161b1b8a831084b366f757c4f0b11) | |
|
127 | local path: file3 (flags "") | |
|
128 | ancestor path: file3 (node 2661d26c649684b482d10f91960cc3db683c38b4) | |
|
129 | other path: file3 (node a2644c43e210356772c7772a8674544a62e06beb) | |
|
112 | 130 | --- file1 --- |
|
113 | 131 | 1 |
|
114 | 132 | changed |
|
115 | 133 | *** file2 does not exist |
|
116 | 134 | --- file3 --- |
|
117 | 135 | 3 |
|
118 | 136 | <<<<<<< local: 13910f48cf7b - test: changed file1, removed file2, changed file3 |
|
119 | 137 | changed2 |
|
120 | 138 | ======= |
|
121 | 139 | changed1 |
|
122 | 140 | >>>>>>> other: 10f9a0a634e8 - test: removed file1, changed file2, changed file3 |
|
123 | 141 | |
|
124 | 142 | |
|
125 | 143 | Interactive merge with bad input: |
|
126 | 144 | |
|
127 | 145 | $ hg co -C |
|
128 | 146 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
129 | 147 | |
|
130 | 148 | $ hg merge --config ui.interactive=true <<EOF |
|
131 | 149 | > foo |
|
132 | 150 | > bar |
|
133 | 151 | > d |
|
134 | 152 | > baz |
|
135 | 153 | > c |
|
136 | 154 | > EOF |
|
137 | 155 | local changed file1 which remote deleted |
|
138 | 156 | use (c)hanged version or (d)elete? foo |
|
139 | 157 | unrecognized response |
|
140 | 158 | local changed file1 which remote deleted |
|
141 | 159 | use (c)hanged version or (d)elete? bar |
|
142 | 160 | unrecognized response |
|
143 | 161 | local changed file1 which remote deleted |
|
144 | 162 | use (c)hanged version or (d)elete? d |
|
145 | 163 | remote changed file2 which local deleted |
|
146 | 164 | use (c)hanged version or leave (d)eleted? baz |
|
147 | 165 | unrecognized response |
|
148 | 166 | remote changed file2 which local deleted |
|
149 | 167 | use (c)hanged version or leave (d)eleted? c |
|
150 | 168 | merging file3 |
|
151 | 169 | warning: conflicts while merging file3! (edit, then use 'hg resolve --mark') |
|
152 | 170 | 1 files updated, 0 files merged, 1 files removed, 1 files unresolved |
|
153 | 171 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon |
|
154 | 172 | [1] |
|
155 | 173 | |
|
156 | 174 | $ status |
|
157 | 175 | --- status --- |
|
158 | 176 | M file2 |
|
159 | 177 | M file3 |
|
160 | 178 | R file1 |
|
161 | 179 | --- resolve --list --- |
|
162 | 180 | U file3 |
|
181 | --- debugmergestate --- | |
|
182 | * version 2 records | |
|
183 | local: 13910f48cf7bdb2a0ba6e24b4900e4fdd5739dd4 | |
|
184 | other: 10f9a0a634e82080907e62f075ab119cbc565ea6 | |
|
185 | file: file3 (record type "F", state "u", hash d5b0a58bc47161b1b8a831084b366f757c4f0b11) | |
|
186 | local path: file3 (flags "") | |
|
187 | ancestor path: file3 (node 2661d26c649684b482d10f91960cc3db683c38b4) | |
|
188 | other path: file3 (node a2644c43e210356772c7772a8674544a62e06beb) | |
|
163 | 189 | *** file1 does not exist |
|
164 | 190 | --- file2 --- |
|
165 | 191 | 2 |
|
166 | 192 | changed |
|
167 | 193 | --- file3 --- |
|
168 | 194 | 3 |
|
169 | 195 | <<<<<<< local: 13910f48cf7b - test: changed file1, removed file2, changed file3 |
|
170 | 196 | changed2 |
|
171 | 197 | ======= |
|
172 | 198 | changed1 |
|
173 | 199 | >>>>>>> other: 10f9a0a634e8 - test: removed file1, changed file2, changed file3 |
|
174 | 200 | |
|
175 | 201 | |
|
176 | 202 | Interactive merge with not enough input: |
|
177 | 203 | |
|
178 | 204 | $ hg co -C |
|
179 | 205 | 2 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
180 | 206 | |
|
181 | 207 | $ hg merge --config ui.interactive=true <<EOF |
|
182 | 208 | > d |
|
183 | 209 | > EOF |
|
184 | 210 | local changed file1 which remote deleted |
|
185 | 211 | use (c)hanged version or (d)elete? d |
|
186 | 212 | remote changed file2 which local deleted |
|
187 | 213 | use (c)hanged version or leave (d)eleted? abort: response expected |
|
188 | 214 | [255] |
|
189 | 215 | |
|
190 | 216 | $ status |
|
191 | 217 | --- status --- |
|
192 | 218 | file2: * (glob) |
|
193 | 219 | C file1 |
|
194 | 220 | C file3 |
|
195 | 221 | --- resolve --list --- |
|
222 | --- debugmergestate --- | |
|
223 | no merge state found | |
|
196 | 224 | --- file1 --- |
|
197 | 225 | 1 |
|
198 | 226 | changed |
|
199 | 227 | *** file2 does not exist |
|
200 | 228 | --- file3 --- |
|
201 | 229 | 3 |
|
202 | 230 | changed2 |
|
203 | 231 | |
|
204 | 232 | Non-interactive linear update |
|
205 | 233 | |
|
206 | 234 | $ hg co -C 0 |
|
207 | 235 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
208 | 236 | $ echo changed >> file1 |
|
209 | 237 | $ hg rm file2 |
|
210 | 238 | $ hg update 1 -y |
|
211 | 239 | local changed file1 which remote deleted |
|
212 | 240 | use (c)hanged version or (d)elete? c |
|
213 | 241 | remote changed file2 which local deleted |
|
214 | 242 | use (c)hanged version or leave (d)eleted? c |
|
215 | 243 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
216 | 244 | $ status |
|
217 | 245 | --- status --- |
|
218 | 246 | A file1 |
|
219 | 247 | C file2 |
|
220 | 248 | C file3 |
|
221 | 249 | --- resolve --list --- |
|
250 | --- debugmergestate --- | |
|
251 | no merge state found | |
|
222 | 252 | --- file1 --- |
|
223 | 253 | 1 |
|
224 | 254 | changed |
|
225 | 255 | --- file2 --- |
|
226 | 256 | 2 |
|
227 | 257 | changed |
|
228 | 258 | --- file3 --- |
|
229 | 259 | 3 |
|
230 | 260 | changed1 |
General Comments 0
You need to be logged in to leave comments.
Login now