[PATCH 4 of 6] verify: invoke the file prefetch hook
Matt Harbison
mharbison72 at gmail.com
Sun Apr 15 02:44:08 EDT 2018
# HG changeset patch
# User Matt Harbison <matt_harbison at yahoo.com>
# Date 1523752111 14400
# Sat Apr 14 20:28:31 2018 -0400
# Node ID 3b0c3d4939b56ca038dbbba17da424699a6b339d
# Parent 691a7d3f2df80908e52a170897a4492a528c3533
verify: invoke the file prefetch hook
It's unfortunate that verify wants to download everything. Maybe we can create
a custom transfer handler for LFS. But it shouldn't be painful in the meantime,
and it's likely that blobs will be served up from more than just hgweb.
diff --git a/mercurial/verify.py b/mercurial/verify.py
--- a/mercurial/verify.py
+++ b/mercurial/verify.py
@@ -25,6 +25,7 @@ from . import (
def verify(repo):
with repo.lock():
+ scmutil.fileprefetchhooks(repo, repo.set('all()'))
return verifier(repo).verify()
def _normpath(f):
diff --git a/tests/test-lfs.t b/tests/test-lfs.t
--- a/tests/test-lfs.t
+++ b/tests/test-lfs.t
@@ -728,21 +728,21 @@ because they aren't accessed.
Verify will copy/link all lfs objects into the local store that aren't already
present. Bypass the corrupted usercache to show that verify works when fed by
-the (uncorrupted) remote store.
+the (uncorrupted) remote store. Also, verify will prefetch all files needed.
$ hg -R fromcorrupt --config lfs.usercache=emptycache verify -v
+ lfs: adding 66100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e to the usercache
+ lfs: adding 89b6070915a3d573ff3599d1cda305bc5e38549b15c4847ab034169da66e1ca8 to the usercache
+ lfs: adding b1a6ea88da0017a0e77db139a54618986e9a2489bee24af9fe596de9daac498c to the usercache
repository uses revlog format 1
checking changesets
checking manifests
crosschecking files in changesets and manifests
checking files
- lfs: adding 66100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e to the usercache
lfs: found 66100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e in the local lfs store
lfs: found 22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b in the local lfs store
lfs: found 66100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e in the local lfs store
- lfs: adding 89b6070915a3d573ff3599d1cda305bc5e38549b15c4847ab034169da66e1ca8 to the usercache
lfs: found 89b6070915a3d573ff3599d1cda305bc5e38549b15c4847ab034169da66e1ca8 in the local lfs store
- lfs: adding b1a6ea88da0017a0e77db139a54618986e9a2489bee24af9fe596de9daac498c to the usercache
lfs: found b1a6ea88da0017a0e77db139a54618986e9a2489bee24af9fe596de9daac498c in the local lfs store
4 files, 5 changesets, 10 total revisions
More information about the Mercurial-devel
mailing list