gecko-dev/python/mozversioncontrol
Connor Sheehan 529144ec47 Bug 1869733: consider all official remotes when finding base ref and patches r=zeid
A previous patch added parsing `git remote -v`, preferring
`mozilla-unified` as the official upstream remote and falling
back to the first official-looking remote if unified was not
found. We assumed that a developer is either using mozilla-unified,
or is using a single-headed repo like central. This overlooks
the fact that it is possible to clone from central, and then
pull other repos in, creating a repo with multiple official
remotes.

Update the `get_upstream_remote` function to find all official
looking remotes instead of a single official remote, and change
the `get_remote_arg` function to return a list of `--remotes`
arguments to be passed to various Git commands. This allows
Git to take all official remotes into consideration and more
precisely find the commits which are not present on any official
upsteams.

Add a test for `get_mozilla_remote_args` while we are here.

Differential Revision: https://phabricator.services.mozilla.com/D199637
2024-01-25 20:04:09 +00:00
..
mozversioncontrol Bug 1869733: consider all official remotes when finding base ref and patches r=zeid 2024-01-25 20:04:09 +00:00
test Bug 1869733: consider all official remotes when finding base ref and patches r=zeid 2024-01-25 20:04:09 +00:00
.ruff.toml Bug 1811850 - [lint] Replace isort linter with ruff, r=taskgraph-reviewers,linter-reviewers,marco,jcristau 2023-03-20 13:06:27 +00:00
setup.py Bug 1801836 - Remove no longer necessary 'from __future__' imports under python/. r=linter-reviewers,glandium,ahal DONTBUILD 2022-12-23 01:26:15 +00:00