Skip to content

Commit

Permalink
Change default value for 'mirror_dir' config option
Browse files Browse the repository at this point in the history
  • Loading branch information
pv committed Aug 29, 2015
1 parent bd6c86e commit 03ed3f7
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
5 changes: 4 additions & 1 deletion asv/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def __init__(self):
self.benchmark_dir = "benchmarks"
self.results_dir = "results"
self.html_dir = "html"
self.mirror_dir = "project"
self.mirror_dir = None
self.show_commit_url = "#"
self.hash_length = 8
self.environment_type = None
Expand Down Expand Up @@ -71,6 +71,9 @@ def from_json(cls, d):
raise util.UserError(
"No branches specified in config file.")

if not getattr(conf, "mirror_dir", None):
conf.mirror_dir = conf.project

return conf

@classmethod
Expand Down
2 changes: 1 addition & 1 deletion asv/template/asv.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
// "env_dir": "env",

// The directory (relative to the current directory) to put the repository
// mirror. If not provided, defaults to "project"
// mirror. If not provided, defaults to the value of "project".
// "mirror_dir": "project",

// The directory (relative to the current directory) that raw benchmark
Expand Down
2 changes: 1 addition & 1 deletion docs/source/asv.conf.json.rst
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ environments in. If not provided, defaults to ``"env"``.
``mirror_dir``
-----------
The directory, relative to the current directory, to put a mirror of
the repository in. If not provided, defaults to ``"project"``.
the repository in. If not provided, defaults to *project*.

``results_dir``
---------------
Expand Down
1 change: 1 addition & 0 deletions test/test_conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ def test_config():
}
assert conf.benchmark_dir == 'benchmark'
assert conf.branches == [None]
assert conf.mirror_dir == conf.project # default value


class CustomCommand(Command):
Expand Down

0 comments on commit 03ed3f7

Please sign in to comment.