comparison tests/test-grab.t @ 3526:df20ddc79064

grab: move the initialization of pctx variable outside of if-else The pctx variable is used outside of the if-else but it was initialized under the conditional statements. Added test for the case when the initialization inside the if-else broke `hg grab --continue`.
author Pulkit Goyal <7895pulkit@gmail.com>
date Sat, 03 Mar 2018 23:31:46 +0530
parents 7fa887cb1a6e
children 7b4d1bfb6b7d
comparison
equal deleted inserted replaced
3525:300d7d019b98 3526:df20ddc79064
179 | 179 |
180 o 3:8e224524cd09 add x 180 o 3:8e224524cd09 add x
181 | 181 |
182 o 0:1f0dee641bb7 add a 182 o 0:1f0dee641bb7 add a
183 183
184
185 When interrupted grab results in no changes to commit
186
187 $ hg up d46dc301d92f
188 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
189 $ echo bar > c
190 $ hg add c
191 $ hg ci -m "foo to c"
192 created new head
193
194 $ hg up 44e155eb95c7
195 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
196
197 $ hg grab 4e04628911f6
198 grabbing 9:4e04628911f6 "foo to c"
199 merging c
200 warning: conflicts while merging c! (edit, then use 'hg resolve --mark')
201 unresolved merge conflicts (see hg help resolve)
202 [1]
203 $ echo foobar > c
204 $ hg resolve -m
205 (no more unresolved files)
206 continue: hg grab --continue
207
208 $ hg grab --continue
209 note: grab of 9:4e04628911f6 created no changes to commit
210
184 Testing the abort functionality of hg grab 211 Testing the abort functionality of hg grab
185 212
186 $ echo foo > b 213 $ echo foo > b
187 $ hg ci -Aqm "foo to b" 214 $ hg ci -Aqm "foo to b"
188 $ hg glog -r .^:: 215 $ hg glog -r .^::
189 @ 9:902d4f4602bb foo to b 216 @ 10:c437988de89f foo to b
190 | 217 |
191 o 8:44e155eb95c7 add c 218 o 8:44e155eb95c7 add c
192 | 219 |
193 ~ 220 ~
194 221
198 warning: conflicts while merging b! (edit, then use 'hg resolve --mark') 225 warning: conflicts while merging b! (edit, then use 'hg resolve --mark')
199 unresolved merge conflicts (see hg help resolve) 226 unresolved merge conflicts (see hg help resolve)
200 [1] 227 [1]
201 228
202 $ hg grab --abort 229 $ hg grab --abort
203 aborting grab, updating to 902d4f4602bb 230 aborting grab, updating to c437988de89f
204 231
205 $ hg glog 232 $ hg glog
206 @ 9:902d4f4602bb foo to b 233 @ 10:c437988de89f foo to b
207 | 234 |
208 o 8:44e155eb95c7 add c 235 o 8:44e155eb95c7 add c
209 | 236 |
210 o 7:2ccc03d1d096 foo to c 237 o 7:2ccc03d1d096 foo to c
211 | 238 |
226 abort: cannot grab public changesets: 7c15c05db6fa 253 abort: cannot grab public changesets: 7c15c05db6fa
227 (see 'hg help phases' for details) 254 (see 'hg help phases' for details)
228 [255] 255 [255]
229 256
230 $ hg glog 257 $ hg glog
231 @ 9:902d4f4602bb foo to b 258 @ 10:c437988de89f foo to b
232 | 259 |
233 o 8:44e155eb95c7 add c 260 o 8:44e155eb95c7 add c
234 | 261 |
235 o 7:2ccc03d1d096 foo to c 262 o 7:2ccc03d1d096 foo to c
236 | 263 |
260 (no more unresolved files) 287 (no more unresolved files)
261 continue: hg grab --continue 288 continue: hg grab --continue
262 289
263 $ hg grab --continue 290 $ hg grab --continue
264 $ hg phase -r . 291 $ hg phase -r .
265 10: secret 292 11: secret
266 293
267 No merge conflicts 294 No merge conflicts
268 295
269 $ hg up d46dc301d92f 296 $ hg up d46dc301d92f
270 0 files updated, 0 files merged, 3 files removed, 0 files unresolved 297 0 files updated, 0 files merged, 3 files removed, 0 files unresolved
271 $ echo foo > l 298 $ echo foo > l
272 $ hg add l 299 $ hg add l
273 $ hg ci -qm "added l" --secret 300 $ hg ci -qm "added l" --secret
274 301
275 $ hg phase -r . 302 $ hg phase -r .
276 11: secret 303 12: secret
277 304
278 $ hg glog 305 $ hg glog
279 @ 11:508d572e7053 added l 306 @ 12:508d572e7053 added l
280 | 307 |
281 | o 10:cd90ed194449 add b 308 | o 11:10427de9e26e add b
282 | | 309 | |
283 | o 9:902d4f4602bb foo to b 310 | o 10:c437988de89f foo to b
284 | | 311 | |
285 | o 8:44e155eb95c7 add c 312 | o 8:44e155eb95c7 add c
286 | | 313 | |
287 | o 7:2ccc03d1d096 foo to c 314 | o 7:2ccc03d1d096 foo to c
288 |/ 315 |/
290 | 317 |
291 o 3:8e224524cd09 add x 318 o 3:8e224524cd09 add x
292 | 319 |
293 o 0:1f0dee641bb7 add a 320 o 0:1f0dee641bb7 add a
294 321
295 $ hg up cd90ed194449 322 $ hg up 10427de9e26e
296 3 files updated, 0 files merged, 1 files removed, 0 files unresolved 323 3 files updated, 0 files merged, 1 files removed, 0 files unresolved
297 324
298 $ hg grab -r 508d572e7053 325 $ hg grab -r 508d572e7053
299 grabbing 11:508d572e7053 "added l" 326 grabbing 12:508d572e7053 "added l"
300 327
301 $ hg phase -r . 328 $ hg phase -r .
302 12: secret 329 13: secret