Make repository select the deepest repository in the directory tree

Review Request #9620 — Created Feb. 11, 2018 and submitted — Latest diff uploaded

Information

RBTools
release-0.7.x
7a16851...

Reviewers

Without the presence of a .reviewboardrc file which defines
REPOSITORY_TYPE, RBTools will try to auto-detect the repository type by running
various commands like "svn info", "hg root", etc. This will run through each
repository type until one is found that works.

Unfortunately, if people have nested repositories, this means
RBTools can select the wrong one. For example, some people may have
/home/user/ as a git directory, and /home/user/src/project/ is a subversion
checkout, running "rbt" within their "project" directory may detect it as git
instead of svn.

This change auto-detects all repository types, and then selects the
deepest one. In the case of multiple matching repositories, we output a
warning suggesting that people define REPOSITORY_TYPE in .reviewboardrc in
order to speed up detection.

  • Tested combinations of nested svn, git, hg repos.
  • All unit tests pass.