Skip to content
Snippets Groups Projects
Commit 8aa027ee authored by Boris Feld's avatar Boris Feld
Browse files

Store repository format information in benchrepo file

parent 20a9a4d5
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/env python
import argparse
import json
import os
import os.path
import shutil
......@@ -37,6 +38,21 @@
["hg", "-R", repo, "--hidden", "branches", "-c", "-T", "{rev}\n"]
)
# Format information
raw_format_data = json.loads(
shell_exec(["hg", "-R", repo, "debugformat", "-T", "json"])
)
format_data = {}
for format_value in raw_format_data:
repo_value = format_value["repo"]
if isinstance(repo_value, basestring):
# String values should be valid ASCII
repo_value = repo_value.encode("ascii")
# Keys should be valid ASCII
format_data[format_value["name"].encode("ascii")] = repo_value
# Generate YAML file
return {
"reference-repo": {
......@@ -50,6 +66,7 @@
"visible": numbranches,
"all": numbrancheshidden,
},
"format-info": format_data,
}
}
......
......@@ -43,6 +43,13 @@
$ tar -axf testrepo-reference.tar testrepo.benchrepo -O
reference-repo:
enabled: true
format-info:
compression: zlib
dotencode: true
fncache: true
generaldelta: true
plain-cl-delta: true
sparserevlog: true
hg-version: * (glob)
id: testrepo
number-heads:
......
......@@ -41,6 +41,13 @@
$ cat my-reference.benchrepo
reference-repo:
enabled: true
format-info:
compression: zlib
dotencode: true
fncache: true
generaldelta: true
plain-cl-delta: true
sparserevlog: true
hg-version: * (glob)
id: my-reference
number-heads:
......@@ -71,6 +78,13 @@
$ cat my-reference.benchrepo
reference-repo:
enabled: true
format-info:
compression: zlib
dotencode: true
fncache: true
generaldelta: true
plain-cl-delta: true
sparserevlog: true
hg-version: * (glob)
id: my-reference
number-heads:
......@@ -159,6 +173,13 @@
$ EDITOR=cat update-reference-config my-reference-reference.tar
reference-repo:
enabled: true
format-info:
compression: zlib
dotencode: true
fncache: true
generaldelta: true
plain-cl-delta: true
sparserevlog: true
hg-version: * (glob)
id: my-reference
number-heads:
......@@ -183,6 +204,13 @@
$ cat my-reference.benchrepo
reference-repo:
enabled: true
format-info:
compression: zlib
dotencode: true
fncache: true
generaldelta: true
plain-cl-delta: true
sparserevlog: true
hg-version: * (glob)
id: my-reference
number-heads:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment