Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
scmperf
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
This instance will be upgraded to Heptapod 17.9.2 on 2025-04-24 between 17:00 and 18:00 UTC+2
Show more breadcrumbs
mercurial
scmperf
Commits
8aa027ee
Commit
8aa027ee
authored
6 years ago
by
Boris Feld
Browse files
Options
Downloads
Patches
Plain Diff
Store repository format information in benchrepo file
parent
20a9a4d5
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
repo-scripts/make-reference
+17
-0
17 additions, 0 deletions
repo-scripts/make-reference
tests/test-make-all.t
+7
-0
7 additions, 0 deletions
tests/test-make-all.t
tests/test-make-reference.t
+28
-0
28 additions, 0 deletions
tests/test-make-reference.t
with
52 additions
and
0 deletions
repo-scripts/make-reference
+
17
−
0
View file @
8aa027ee
#!/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
,
}
}
...
...
This diff is collapsed.
Click to expand it.
tests/test-make-all.t
+
7
−
0
View file @
8aa027ee
...
...
@@ -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:
...
...
This diff is collapsed.
Click to expand it.
tests/test-make-reference.t
+
28
−
0
View file @
8aa027ee
...
...
@@ -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:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment