diff 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
line wrap: on
line diff
--- a/tests/test-prev-next.t	Sun Jun 03 02:50:55 2018 +0530
+++ b/tests/test-prev-next.t	Sun Jun 03 02:36:24 2018 +0530
@@ -397,11 +397,10 @@
 
   $ echo bar > wat
   $ hg prev
-  abort: uncommitted changes
-  (do you want --merge?)
-  [255]
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  [1] added foo
   $ hg diff
-  diff -r ac3de1218820 wat
+  diff -r cf959ce4e1ff wat
   --- a/wat	Thu Jan 01 00:00:00 1970 +0000
   +++ b/wat	Thu Jan 01 00:00:00 1970 +0000
   @@ -1,1 +1,1 @@
@@ -410,10 +409,6 @@
 
 testing for `hg next`
 
-  $ echo hi > wat
-  $ hg up .^
-  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
-  $ echo bar > wat
   $ hg next
   abort: uncommitted changes
   (do you want --merge?)