Mercurial > evolve
comparison tests/test-prev-next.t @ 3781:e73a73b27f3e stable
prev: respect `commands.update.check` config option in `hg prev` (issue5808)
`commands.update.check` config option determines what level of checking should
be done when we update to another revision. When we set this config option to
`noconflict`, it updates your working directory to a specified revision only
when there will be no conflicts which is a very nice behavior.
This patch adds logic to respect the config option so that we can have that nice
behavior with `hg prev` too.
It turns out, we just needed to use hg.updatetotally() and add some cases to
check config option.
Right now, we only respect the config if value is set to `noconflict`. Otherwise
we fallback to the default behavior.
This is a part of fixing issue5808. Test changes demonstrate the fix.
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Sun, 03 Jun 2018 02:36:24 +0530 |
parents | 9da11755d615 |
children | 27cf636b2f4d |
comparison
equal
deleted
inserted
replaced
3780:9da11755d615 | 3781:e73a73b27f3e |
---|---|
395 | 395 |
396 testing for `hg prev` | 396 testing for `hg prev` |
397 | 397 |
398 $ echo bar > wat | 398 $ echo bar > wat |
399 $ hg prev | 399 $ hg prev |
400 abort: uncommitted changes | 400 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
401 (do you want --merge?) | 401 [1] added foo |
402 [255] | |
403 $ hg diff | 402 $ hg diff |
404 diff -r ac3de1218820 wat | 403 diff -r cf959ce4e1ff wat |
405 --- a/wat Thu Jan 01 00:00:00 1970 +0000 | 404 --- a/wat Thu Jan 01 00:00:00 1970 +0000 |
406 +++ b/wat Thu Jan 01 00:00:00 1970 +0000 | 405 +++ b/wat Thu Jan 01 00:00:00 1970 +0000 |
407 @@ -1,1 +1,1 @@ | 406 @@ -1,1 +1,1 @@ |
408 -hi | 407 -hi |
409 +bar | 408 +bar |
410 | 409 |
411 testing for `hg next` | 410 testing for `hg next` |
412 | 411 |
413 $ echo hi > wat | |
414 $ hg up .^ | |
415 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
416 $ echo bar > wat | |
417 $ hg next | 412 $ hg next |
418 abort: uncommitted changes | 413 abort: uncommitted changes |
419 (do you want --merge?) | 414 (do you want --merge?) |
420 [255] | 415 [255] |
421 $ hg diff | 416 $ hg diff |