diff benchmark/benchmark_utils.jl @ 1313:708dbfd5edb9 tooling/benchmarks

Make hg_at_revision() return the result of f
author Jonatan Werpers <jonatan@werpers.com>
date Thu, 27 Apr 2023 08:48:28 +0200
parents f7621dd600e4
children 0551fd71682f
line wrap: on
line diff
--- a/benchmark/benchmark_utils.jl	Wed Apr 26 13:46:37 2023 +0200
+++ b/benchmark/benchmark_utils.jl	Thu Apr 27 08:48:28 2023 +0200
@@ -191,10 +191,10 @@
 function hg_at_revision(f, rev)
     if hg_is_dirty()
         hg_with_temporary_commit() do
-            _hg_at_revision(f, rev)
+            return _hg_at_revision(f, rev)
         end
     else
-        _hg_at_revision(f, rev)
+        return _hg_at_revision(f, rev)
     end
 end
 
@@ -205,7 +205,7 @@
 
     hg_update(rev)
     try
-        f()
+        return f()
     finally
         hg_update(origin_rev)
     end
@@ -224,7 +224,7 @@
     origin_rev = hg_commit("[Automatic commit by julia]",secret=true)
 
     try
-        f()
+        return f()
     finally
         hg_update(origin_rev)
         hg_strip(origin_rev; keep=true)