changeset 47450:9cecc222c536

revlogv2: fix `hg verify` with revlog v2 We added a bunch of new files but we never teached some internal about it. This is now fixed. Differential Revision: https://phab.mercurial-scm.org/D10858
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Wed, 09 Jun 2021 12:19:42 +0200
parents da3fb8c10caa
children f70ca39d0ab8
files mercurial/revlog.py tests/test-revlog-v2.t
diffstat 2 files changed, 27 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/revlog.py	Tue Jun 08 02:34:59 2021 +0200
+++ b/mercurial/revlog.py	Wed Jun 09 12:19:42 2021 +0200
@@ -2828,8 +2828,15 @@
 
     def files(self):
         res = [self._indexfile]
-        if not self._inline:
-            res.append(self._datafile)
+        if self._docket_file is None:
+            if not self._inline:
+                res.append(self._datafile)
+        else:
+            res.append(self._docket_file)
+            if self._docket.data_end:
+                res.append(self._datafile)
+            if self._docket.sidedata_end:
+                res.append(self._sidedatafile)
         return res
 
     def emitrevisions(
--- a/tests/test-revlog-v2.t	Tue Jun 08 02:34:59 2021 +0200
+++ b/tests/test-revlog-v2.t	Wed Jun 09 12:19:42 2021 +0200
@@ -119,3 +119,21 @@
 The two repository should be identical, this diff MUST be empty
 
   $ cmp ../tip-new ../tip-cloned || diff -U8 ../tip-new ../tip-cloned
+
+
+hg verify should be happy
+-------------------------
+
+  $ hg verify
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  checked 1 changesets with 1 changes to 1 files
+
+  $ hg verify -R ../cloned-repo
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  checked 1 changesets with 1 changes to 1 files