Move SCM-provided repository name out of RepositoryInfo structure.

Review Request #11504 — Created March 8, 2021 and submitted — Latest diff uploaded

Information

RBTools
master

Reviewers

Perforce allows administrators to configure the repository name into the
p4 counters. This was then used in the case where the name was not
already provided from the config or command line options. Unfortunately,
this was stuck into the RepositoryInfo structure, which wasn't the best
place for it. This also meant that even when the repository name was
configured in .reviewboardrc, we'd query the p4 counters looking for it.

This change moves the repository name out of the RepositoryInfo
structure and into a method which is only called if the repository name
is not provided in another way. It also actually uses that name when
querying the repositories inside the get_repository_id method (as
opposed to fetching all repositories and then comparing against the
name).

  • Ran unit tests.
  • Verified that get_repository_id was now only fetching a single
    repository from the API during commands such as rbt status and
    rbt post -u.

Diff Revision 1

This is not the most recent revision of the diff. The latest diff is revision 3. See what's changed.

orig
1
2
3

Commits

First Last Summary ID Author
Move SCM-provided repository name out of RepositoryInfo structure.
Perforce allows administrators to configure the repository name into the p4 counters. This was then used in the case where the name was not already provided from the config or command line options. Unfortunately, this was stuck into the RepositoryInfo structure, which wasn't the best place for it. This also meant that even when the repository name was configured in .reviewboardrc, we'd query the p4 counters looking for it. This change moves the repository name out of the RepositoryInfo structure and into a method which is only called if the repository name is not provided in another way. It also actually uses that name when querying the repositories inside the `get_repository_id` method (as opposed to fetching all repositories and then comparing against the name). Testing Done: - Ran unit tests. - Verified that `get_repository_id` was now only fetching a single repository from the API during commands such as `rbt status` and `rbt post -u`.
05939566a81bf59ca12dbc3dcf37bc835b5ff08d David Trowbridge
rbtools/clients/__init__.py
rbtools/clients/perforce.py
rbtools/clients/tests/test_p4.py
rbtools/commands/__init__.py
rbtools/utils/repository.py
Loading...