comparison 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
comparison
equal deleted inserted replaced
1306:c14370f7c731 1307:27afd53511d4
129 function hg_update(rev) 129 function hg_update(rev)
130 cmd = Cmd(`hg update --check -r $rev`, dir=sbplib_root) 130 cmd = Cmd(`hg update --check -r $rev`, dir=sbplib_root)
131 run(addenv(cmd, "HGPLAIN"=>"")) 131 run(addenv(cmd, "HGPLAIN"=>""))
132 end 132 end
133 133
134 function hg_commit(msg) 134 """
135 cmd = Cmd(`hg commit --verbose --message $msg`, dir=sbplib_root) 135 hg_commit(msg; secret=false)
136
137 Make a hg commit with the provided message. If `secret` is true the commit is
138 in the secret phase stopping it from being pushed.
139 """
140 function hg_commit(msg; secret=false)
141 if secret
142 secretflag = "--secret"
143 else
144 secretflag = ""
145 end
146
147 cmd = Cmd(`hg commit --verbose $secretflag --message $msg`, dir=sbplib_root)
136 out = readchomp(addenv(cmd, "HGPLAIN"=>"")) 148 out = readchomp(addenv(cmd, "HGPLAIN"=>""))
137 149
138 return only(match(r"committed changeset \d+:([0-9a-z]+)", out)) 150 return only(match(r"committed changeset \d+:([0-9a-z]+)", out))
139 end 151 end
140 152