Patchwork [STABLE] verify: do not prevent verify repository containing hidden changesets

login
register
mail settings
Submitter Yuya Nishihara
Date Feb. 19, 2014, 1:56 p.m.
Message ID <dd615eff382bd7c5ccb9.1392818214@gimlet>
Download mbox | patch
Permalink /patch/3696/
State Accepted
Commit 78f547cdc362f736e061d86f2c79f9a7d57d5120
Headers show

Comments

Yuya Nishihara - Feb. 19, 2014, 1:56 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1392815985 -32400
#      Wed Feb 19 22:19:45 2014 +0900
# Branch stable
# Node ID dd615eff382bd7c5ccb96289408167da00edd458
# Parent  e4a4e4b993ffd4fac6ea53b3928bbc91fc9e8613
verify: do not prevent verify repository containing hidden changesets

Since a959f7167077, repo.cancopy() cannot be used to check if the repo is
a bundlerepository.

repo.url() should always have "scheme:", so it isn't necessary to parse
by util.url().
Matt Mackall - Feb. 19, 2014, 10:12 p.m.
On Wed, 2014-02-19 at 22:56 +0900, Yuya Nishihara wrote:
> # HG changeset patch
> # User Yuya Nishihara <yuya@tcha.org>
> # Date 1392815985 -32400
> #      Wed Feb 19 22:19:45 2014 +0900
> # Branch stable
> # Node ID dd615eff382bd7c5ccb96289408167da00edd458
> # Parent  e4a4e4b993ffd4fac6ea53b3928bbc91fc9e8613
> verify: do not prevent verify repository containing hidden changesets

Queued for stable, thanks.

Patch

diff --git a/mercurial/verify.py b/mercurial/verify.py
--- a/mercurial/verify.py
+++ b/mercurial/verify.py
@@ -38,7 +38,7 @@  def _verify(repo):
     mf = repo.manifest
     lrugetctx = util.lrucachefunc(repo.changectx)
 
-    if not repo.cancopy():
+    if not repo.url().startswith('file:'):
         raise util.Abort(_("cannot verify bundle or remote repos"))
 
     def err(linkrev, msg, filename=None):
diff --git a/tests/test-phases.t b/tests/test-phases.t
--- a/tests/test-phases.t
+++ b/tests/test-phases.t
@@ -549,4 +549,13 @@  test hidden changeset are not cloned as 
   o  0 public A
   
 
+test verify repo containing hidden changesets, which should not abort just
+because repo.cancopy() is False
 
+  $ cd ../initialrepo
+  $ hg verify
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  7 files, 8 changesets, 7 total revisions