Clean up config handling in rbtools and fix search path.

Review Request #7001 — Created March 2, 2015 and submitted — Latest diff uploaded

Information

RBTools
release-0.7.x
4e2943b...

Reviewers

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 the user_config from the home directory. After our big
clients/commands refactors, the configs list had only one item, and it was
the same as the user_config. We also still had the old load_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 separate configs vs. user_config, and everything is nice and clean.

Testing done:
- Ran unit tests.
- Ran rbt list-repo-types (for the extra load_scmtools() call)
- Posted this change.

  • Ran unit tests.
  • Ran rbt list-repo-types (for the extra load_scmtools() call)
  • Posted this change.
    Loading...