changeset 42149:84b5ad5fc2aa stable

merge: forgot to pull before release These two changes should be part of 5.0, but we are fine leaving them out of the RC.
author Augie Fackler <augie@google.com>
date Wed, 17 Apr 2019 14:10:02 -0400
parents e76eb64d7f71 (current diff) 607a0de9bae3 (diff)
children 71d8b4d91616
files
diffstat 5 files changed, 82 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Wed Apr 17 13:56:10 2019 -0400
+++ b/mercurial/commands.py	Wed Apr 17 14:10:02 2019 -0400
@@ -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',
--- a/mercurial/debugcommands.py	Wed Apr 17 13:56:10 2019 -0400
+++ b/mercurial/debugcommands.py	Wed Apr 17 14:10:02 2019 -0400
@@ -829,6 +829,7 @@
     data['nb-common'] = len(common)
     data['nb-common-local'] = len(common & lheads)
     data['nb-common-remote'] = len(common & rheads)
+    data['nb-common-both'] = len(common & rheads & lheads)
     data['nb-local'] = len(lheads)
     data['nb-local-missing'] = data['nb-local'] - data['nb-common-local']
     data['nb-remote'] = len(rheads)
@@ -843,6 +844,7 @@
     ui.write(("  total common heads:  %(nb-common)9d\n") % data)
     ui.write(("    also local heads:  %(nb-common-local)9d\n") % data)
     ui.write(("    also remote heads: %(nb-common-remote)9d\n") % data)
+    ui.write(("    both:              %(nb-common-both)9d\n") % data)
     ui.write(("  local heads:         %(nb-local)9d\n") % data)
     ui.write(("    common:            %(nb-common-local)9d\n") % data)
     ui.write(("    missing:           %(nb-local-missing)9d\n") % data)
--- a/tests/test-completion.t	Wed Apr 17 13:56:10 2019 -0400
+++ b/tests/test-completion.t	Wed Apr 17 14:10:02 2019 -0400
@@ -332,7 +332,7 @@
   phase: public, draft, secret, force, rev
   pull: update, force, rev, bookmark, branch, ssh, remotecmd, insecure
   push: force, rev, bookmark, branch, new-branch, pushvars, publish, ssh, remotecmd, insecure
-  recover: 
+  recover: verify
   remove: after, force, subrepos, include, exclude, dry-run
   rename: after, force, include, exclude, dry-run
   resolve: all, list, mark, unmark, no-status, re-merge, tool, include, exclude, template
--- a/tests/test-journal-exists.t	Wed Apr 17 13:56:10 2019 -0400
+++ b/tests/test-journal-exists.t	Wed Apr 17 14:10:02 2019 -0400
@@ -21,6 +21,33 @@
   checking files
   checked 1 changesets with 1 changes to 1 files
 
+recover, explicite verify
+
+  $ touch .hg/store/journal
+  $ hg ci -Am0
+  abort: abandoned transaction found!
+  (run 'hg recover' to clean up transaction)
+  [255]
+  $ hg recover --verify
+  rolling back interrupted transaction
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  checked 1 changesets with 1 changes to 1 files
+
+recover, no verify
+
+  $ touch .hg/store/journal
+  $ hg ci -Am0
+  abort: abandoned transaction found!
+  (run 'hg recover' to clean up transaction)
+  [255]
+  $ hg recover --no-verify
+  rolling back interrupted transaction
+  (verify step skipped, run  `hg verify` to check your repository content)
+
+
 Check that zero-size journals are correctly aborted:
 
 #if unix-permissions no-root
--- a/tests/test-setdiscovery.t	Wed Apr 17 13:56:10 2019 -0400
+++ b/tests/test-setdiscovery.t	Wed Apr 17 14:10:02 2019 -0400
@@ -48,6 +48,7 @@
     total common heads:          2
       also local heads:          2
       also remote heads:         1
+      both:                      1
     local heads:                 2
       common:                    2
       missing:                   0
@@ -69,6 +70,7 @@
     total common heads:          2
       also local heads:          2
       also remote heads:         1
+      both:                      1
     local heads:                 2
       common:                    2
       missing:                   0
@@ -90,6 +92,7 @@
     total common heads:          1
       also local heads:          1
       also remote heads:         0
+      both:                      0
     local heads:                 2
       common:                    1
       missing:                   1
@@ -110,6 +113,7 @@
     total common heads:          2
       also local heads:          1
       also remote heads:         2
+      both:                      1
     local heads:                 3
       common:                    1
       missing:                   2
@@ -131,6 +135,7 @@
     total common heads:          2
       also local heads:          1
       also remote heads:         2
+      both:                      1
     local heads:                 3
       common:                    1
       missing:                   2
@@ -152,6 +157,7 @@
     total common heads:          2
       also local heads:          1
       also remote heads:         2
+      both:                      1
     local heads:                 3
       common:                    1
       missing:                   2
@@ -179,6 +185,7 @@
     total common heads:          1
       also local heads:          1
       also remote heads:         0
+      both:                      0
     local heads:                 2
       common:                    1
       missing:                   1
@@ -203,6 +210,7 @@
     total common heads:          1
       also local heads:          1
       also remote heads:         0
+      both:                      0
     local heads:                 2
       common:                    1
       missing:                   1
@@ -227,6 +235,7 @@
     total common heads:          1
       also local heads:          0
       also remote heads:         0
+      both:                      0
     local heads:                 2
       common:                    0
       missing:                   2
@@ -247,6 +256,7 @@
     total common heads:          1
       also local heads:          0
       also remote heads:         1
+      both:                      0
     local heads:                 1
       common:                    0
       missing:                   1
@@ -271,6 +281,7 @@
     total common heads:          1
       also local heads:          0
       also remote heads:         1
+      both:                      0
     local heads:                 1
       common:                    0
       missing:                   1
@@ -295,6 +306,7 @@
     total common heads:          1
       also local heads:          0
       also remote heads:         1
+      both:                      0
     local heads:                 1
       common:                    0
       missing:                   1
@@ -321,6 +333,7 @@
     total common heads:          1
       also local heads:          1
       also remote heads:         0
+      both:                      0
     local heads:                 2
       common:                    1
       missing:                   1
@@ -345,6 +358,7 @@
     total common heads:          1
       also local heads:          1
       also remote heads:         0
+      both:                      0
     local heads:                 2
       common:                    1
       missing:                   1
@@ -369,6 +383,7 @@
     total common heads:          1
       also local heads:          0
       also remote heads:         0
+      both:                      0
     local heads:                 2
       common:                    0
       missing:                   2
@@ -389,6 +404,7 @@
     total common heads:          1
       also local heads:          0
       also remote heads:         1
+      both:                      0
     local heads:                 1
       common:                    0
       missing:                   1
@@ -413,6 +429,7 @@
     total common heads:          1
       also local heads:          0
       also remote heads:         1
+      both:                      0
     local heads:                 1
       common:                    0
       missing:                   1
@@ -437,6 +454,7 @@
     total common heads:          1
       also local heads:          0
       also remote heads:         1
+      both:                      0
     local heads:                 1
       common:                    0
       missing:                   1
@@ -464,6 +482,7 @@
     total common heads:          1
       also local heads:          0
       also remote heads:         0
+      both:                      0
     local heads:                 1
       common:                    0
       missing:                   1
@@ -488,6 +507,7 @@
     total common heads:          1
       also local heads:          0
       also remote heads:         0
+      both:                      0
     local heads:                 1
       common:                    0
       missing:                   1
@@ -512,6 +532,7 @@
     total common heads:          1
       also local heads:          0
       also remote heads:         0
+      both:                      0
     local heads:                 1
       common:                    0
       missing:                   1
@@ -532,6 +553,7 @@
     total common heads:          1
       also local heads:          0
       also remote heads:         0
+      both:                      0
     local heads:                 1
       common:                    0
       missing:                   1
@@ -556,6 +578,7 @@
     total common heads:          1
       also local heads:          0
       also remote heads:         0
+      both:                      0
     local heads:                 1
       common:                    0
       missing:                   1
@@ -580,6 +603,7 @@
     total common heads:          1
       also local heads:          0
       also remote heads:         0
+      both:                      0
     local heads:                 1
       common:                    0
       missing:                   1
@@ -607,6 +631,7 @@
     total common heads:          1
       also local heads:          0
       also remote heads:         0
+      both:                      0
     local heads:                 1
       common:                    0
       missing:                   1
@@ -631,6 +656,7 @@
     total common heads:          1
       also local heads:          0
       also remote heads:         0
+      both:                      0
     local heads:                 1
       common:                    0
       missing:                   1
@@ -655,6 +681,7 @@
     total common heads:          1
       also local heads:          0
       also remote heads:         0
+      both:                      0
     local heads:                 1
       common:                    0
       missing:                   1
@@ -675,6 +702,7 @@
     total common heads:          1
       also local heads:          0
       also remote heads:         0
+      both:                      0
     local heads:                 1
       common:                    0
       missing:                   1
@@ -699,6 +727,7 @@
     total common heads:          1
       also local heads:          0
       also remote heads:         0
+      both:                      0
     local heads:                 1
       common:                    0
       missing:                   1
@@ -723,6 +752,7 @@
     total common heads:          1
       also local heads:          0
       also remote heads:         0
+      both:                      0
     local heads:                 1
       common:                    0
       missing:                   1
@@ -750,6 +780,7 @@
     total common heads:          1
       also local heads:          0
       also remote heads:         0
+      both:                      0
     local heads:                 1
       common:                    0
       missing:                   1
@@ -777,6 +808,7 @@
     total common heads:          1
       also local heads:          0
       also remote heads:         0
+      both:                      0
     local heads:                 1
       common:                    0
       missing:                   1
@@ -804,6 +836,7 @@
     total common heads:          1
       also local heads:          0
       also remote heads:         0
+      both:                      0
     local heads:                 1
       common:                    0
       missing:                   1
@@ -824,6 +857,7 @@
     total common heads:          1
       also local heads:          0
       also remote heads:         0
+      both:                      0
     local heads:                 1
       common:                    0
       missing:                   1
@@ -851,6 +885,7 @@
     total common heads:          1
       also local heads:          0
       also remote heads:         0
+      both:                      0
     local heads:                 1
       common:                    0
       missing:                   1
@@ -878,6 +913,7 @@
     total common heads:          1
       also local heads:          0
       also remote heads:         0
+      both:                      0
     local heads:                 1
       common:                    0
       missing:                   1
@@ -957,6 +993,7 @@
     total common heads:          1
       also local heads:          0
       also remote heads:         0
+      both:                      0
     local heads:               260
       common:                    0
       missing:                 260
@@ -983,6 +1020,7 @@
     total common heads:          1
       also local heads:          0
       also remote heads:         0
+      both:                      0
     local heads:               260
       common:                    0
       missing:                 260