Clean up config handling in rbtools and fix search path.
Review Request #7001 — Created March 2, 2015 and submitted — Latest diff uploaded
One pretty major change between the way post-review handled configs and the way
rbt handled configs is that in post-review, $HOME/.reviewboardrc was considered
last, whereas in rbt, it was considered first. I've changed our new
load_config implementation so that any .reviewboardrc files in your current
directory (or a parent of your current directory) take priority over the one in
the home directory.As I did this, I noticed that the way config was passed around was pretty
crazy. Once upon a time the clients had a list of each config file, and then a
separate entry for theuser_config
from the home directory. After our big
clients/commands refactors, theconfigs
list had only one item, and it was
the same as theuser_config
. We also still had the oldload_config_files
implementation, which was still used in some unit tests.I've cleaned all this up so that we instantiate SCMClients with a single config
dictionary, which is populated according to the above search order. There's no
more separateconfigs
vs.user_config
, and everything is nice and clean.Testing done:
- Ran unit tests.
- Ranrbt list-repo-types
(for the extraload_scmtools()
call)
- Posted this change.
- Ran unit tests.
- Ran
rbt list-repo-types
(for the extraload_scmtools()
call) - Posted this change.