mercurial/commands.py
changeset 42144 013de80bf90e
parent 42130 a362b0b95e42
child 42156 496ac8a02380
child 42555 50eacdeea88c
--- a/mercurial/commands.py	Tue Apr 02 19:48:31 2019 +0200
+++ b/mercurial/commands.py	Wed Apr 17 00:37:00 2019 +0200
@@ -4655,8 +4655,11 @@
 
     return result
 
-@command('recover', [], helpcategory=command.CATEGORY_MAINTENANCE)
-def recover(ui, repo):
+@command('recover',
+    [('','verify', True, "run `hg verify` after succesful recover"),
+    ],
+    helpcategory=command.CATEGORY_MAINTENANCE)
+def recover(ui, repo, **opts):
     """roll back an interrupted transaction
 
     Recover from an interrupted commit or pull.
@@ -4667,8 +4670,15 @@
 
     Returns 0 if successful, 1 if nothing to recover or verify fails.
     """
-    if repo.recover():
-        return hg.verify(repo)
+    ret = repo.recover()
+    if ret:
+        if opts['verify']:
+            return hg.verify(repo)
+        else:
+            msg = _("(verify step skipped, run  `hg verify` to check your "
+                    "repository content)\n")
+            ui.warn(msg)
+            return 0
     return 1
 
 @command('remove|rm',