diff benchmark/benchmark_utils.jl @ 1307:27afd53511d4 tooling/benchmarks

Add flag to make commit secret in hg_commit()
author Jonatan Werpers <jonatan@werpers.com>
date Wed, 26 Apr 2023 13:23:37 +0200
parents c14370f7c731
children a8e76daaf2ae
line wrap: on
line diff
--- a/benchmark/benchmark_utils.jl	Wed Apr 26 13:09:55 2023 +0200
+++ b/benchmark/benchmark_utils.jl	Wed Apr 26 13:23:37 2023 +0200
@@ -131,8 +131,20 @@
     run(addenv(cmd, "HGPLAIN"=>""))
 end
 
-function hg_commit(msg)
-    cmd = Cmd(`hg commit --verbose --message $msg`, dir=sbplib_root)
+"""
+    hg_commit(msg; secret=false)
+
+Make a hg commit with the provided message. If `secret` is true the commit is
+in the secret phase stopping it from being pushed.
+"""
+function hg_commit(msg; secret=false)
+    if secret
+        secretflag = "--secret"
+    else
+        secretflag = ""
+    end
+
+    cmd = Cmd(`hg commit --verbose $secretflag --message $msg`, dir=sbplib_root)
     out = readchomp(addenv(cmd, "HGPLAIN"=>""))
 
     return only(match(r"committed changeset \d+:([0-9a-z]+)", out))