comparison benchmark/benchmark_utils.jl @ 1310:8754d0f06ce4 tooling/benchmarks

Add hg_strip()
author Jonatan Werpers <jonatan@werpers.com>
date Wed, 26 Apr 2023 13:38:34 +0200
parents 7fc84c2f9e1d
children 5eb1d0ae0ac1
comparison
equal deleted inserted replaced
1309:7fc84c2f9e1d 1310:8754d0f06ce4
149 out = readchomp(addenv(cmd, "HGPLAIN"=>"")) 149 out = readchomp(addenv(cmd, "HGPLAIN"=>""))
150 150
151 return only(match(r"committed changeset \d+:([0-9a-z]+)", out)) 151 return only(match(r"committed changeset \d+:([0-9a-z]+)", out))
152 end 152 end
153 153
154 """
155 hg_strip(rev; keep=false)
156
157 Strips the given commit from the repo. If `keep` is true, the changes of the
158 commit are kept in the working directory.
159 """
160 function hg_strip(rev; keep=false)
161 if keep
162 cmd = Cmd(`hg --config extensions.strip= strip --keep -r $rev`, dir=sbplib_root)
163 else
164 cmd = Cmd(`hg --config extensions.strip= strip -r $rev`, dir=sbplib_root)
165 end
166
167 run(addenv(cmd, "HGPLAIN"=>""))
168
169 return nothing
170 end
154 function hg_is_dirty() 171 function hg_is_dirty()
155 cmd = Cmd(`hg identify --id`, dir=sbplib_root) 172 cmd = Cmd(`hg identify --id`, dir=sbplib_root)
156 out = readchomp(addenv(cmd, "HGPLAIN"=>"")) 173 out = readchomp(addenv(cmd, "HGPLAIN"=>""))
157 174
158 return endswith(out, "+") 175 return endswith(out, "+")