compare-disco: support for `file` nodes specification
authorPierre-Yves DAVID <pierre-yves.david@octobus.net>
Sun, 05 Jun 2022 07:16:29 +0200
changeset 49463 5acbc550d987
parent 49462 ef0b0f94d2e5
child 49473 f59e49f6bee4
compare-disco: support for `file` nodes specification This leverage the `nodefromfile` feature in core. This make it possible for callers to no longer pay the subset computation cost (and to make sure the subset is the right one, even when the base repository is different)
contrib/perf-utils/compare-discovery-case
--- a/contrib/perf-utils/compare-discovery-case	Sat Jun 04 19:10:51 2022 +0200
+++ b/contrib/perf-utils/compare-discovery-case	Sun Jun 05 07:16:29 2022 +0200
@@ -99,7 +99,11 @@
 
 def parse_case(case):
     case_type, case_args = case.split('-', 1)
-    case = (case_type,) + tuple(int(x) for x in case_args.split('-'))
+    if case_type == 'file':
+        case_args = (case_args,)
+    else:
+        case_args = tuple(int(x) for x in case_args.split('-'))
+    case = (case_type,) + case_args
     return case
 
 
@@ -115,6 +119,8 @@
         return '::randomantichain(all(), "%d")' % case[1]
     elif t == 'rev':
         return '::%d' % case[1]
+    elif t == 'file':
+        return '::nodefromfile("%s")' % case[1]
     else:
         assert False