Update and streamline local repository type detection.

Review Request #11503 — Created March 4, 2021 and submitted — Latest diff uploaded

Information

RBTools
master

Reviewers

The way that the local repository type was detected overly complicated
and inefficient. We would go through and assemble a complete
RepositoryInfo for each possible repository, potentially doing excess
computation that would just be thrown away. In addition, there were some
situtations where a repository would be operating in a remote-only mode
(for example, using SVN with the --repository-url option) where we
were scanning everything locally before finally using the remote.

This change reworks the local repository detection in RBTools to
work in three phases:

  1. First we ask each tool if it's operating in "remote only" mode. At
    the moment, SVN is the only such tool, but it's easy to imagine other
    server-heavy services gaining this ability.
  2. Second, we scan through each tool to see if it thinks there's an
    active repository. This has been simplified to only fetch the local
    working directory from the tool, rather than the full repository
    info.
  3. Finally, after having chosen a tool, we ask it for the repository
    info structure.
  • Ran unit tests.
  • Smoke tested tools that use the repository.

Changes between revision 2 and 3

orig
1
2
3
4
5

Commits

Summary ID Author
Update and streamline local repository type detection.
The way that the local repository type was detected overly complicated and inefficient. We would go through and assemble a complete `RepositoryInfo` for each possible repository, potentially doing excess computation that would just be thrown away. In addition, there were some situtations where a repository would be operating in a remote-only mode (for example, using SVN with the `--repository-url` option) where we were scanning everything locally before finally using the remote. This change reworks the local repository detection in RBTools to work in three phases: 1. First we ask each tool if it's operating in "remote only" mode. At the moment, SVN is the only such tool, but it's easy to imagine other server-heavy services gaining this ability. 2. Second, we scan through each tool to see if it thinks there's an active repository. This has been simplified to only fetch the local working directory from the tool, rather than the full repository info. 3. Finally, after having chosen a tool, we ask it for the repository info structure. Testing Done: - Ran unit tests. - Smoke tested tools that use the repository.
e8523194c8288854a22ec91f99a81442aca7f6a6 David Trowbridge
Update and streamline local repository type detection.
The way that the local repository type was detected overly complicated and inefficient. We would go through and assemble a complete `RepositoryInfo` for each possible repository, potentially doing excess computation that would just be thrown away. In addition, there were some situtations where a repository would be operating in a remote-only mode (for example, using SVN with the `--repository-url` option) where we were scanning everything locally before finally using the remote. This change reworks the local repository detection in RBTools to work in three phases: 1. First we ask each tool if it's operating in "remote only" mode. At the moment, SVN is the only such tool, but it's easy to imagine other server-heavy services gaining this ability. 2. Second, we scan through each tool to see if it thinks there's an active repository. This has been simplified to only fetch the local working directory from the tool, rather than the full repository info. 3. Finally, after having chosen a tool, we ask it for the repository info structure. Testing Done: - Ran unit tests. - Smoke tested tools that use the repository.
213a192a6ed2f21901e6b575faf42c57735a9a91 David Trowbridge
rbtools/clients/__init__.py
rbtools/clients/clearcase.py
rbtools/clients/git.py
rbtools/clients/mercurial.py
rbtools/clients/perforce.py
rbtools/clients/plastic.py
rbtools/clients/svn.py
rbtools/clients/tfs.py
rbtools/clients/tests/test_scanning.py
rbtools/commands/__init__.py
Loading...