diff contrib/dumprevlog @ 47150:8d3c2f9d4af7

revlog: use a "radix" to address revlog Instead of pointing to the index directly and to derive the other file from that, we directly provide the radix and let the revlog determine the associated file path internally. This is more robust and will give us more flexibility for picking this file name in the future. Differential Revision: https://phab.mercurial-scm.org/D10576
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Mon, 03 May 2021 12:22:36 +0200
parents 4c041c71ec01
children 5d5abfdc32d8
line wrap: on
line diff
--- a/contrib/dumprevlog	Mon May 03 12:22:26 2021 +0200
+++ b/contrib/dumprevlog	Mon May 03 12:22:36 2021 +0200
@@ -36,10 +36,15 @@
 
 
 for f in sys.argv[1:]:
+    localf = encoding.strtolocal(f)
+    if not localf.endswith(b'.i'):
+        print("file:", f, file=sys.stderr)
+        print("  invalida filename", file=sys.stderr)
+
     r = revlog.revlog(
         binopen,
         target=(revlog_constants.KIND_OTHER, b'dump-revlog'),
-        indexfile=encoding.strtolocal(f),
+        radix=localf[:-2],
     )
     print("file:", f)
     for i in r: