Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mozautomation: match built URIs exactly in
resolve_uri_to_tree
(Bug…
… 1768982) r=zeid `resolve_uri_to_tree` takes a URI (ie `https://hg.mozilla.org/mozilla-central`) and attempts to resolve it to a known Firefox tree shortname (ie `central`). It does so by iterating through the list of known Firefox tree repo names and building out each potential URI, and then checking if each built URI matches the passed URI. The matching condition used is `uri.startswith`, assumedly so something like `https://hg.mozilla.org/mozilla-centra` or some other minor typo results in a match still being found. This has worked without any issue to date, until `esr102` was created. Since the built URIs for esr10 would match the `startswith` metric on `esr102`, passing the URI for esr102 is returning `esr10` as the resolved tree. Switch `resolve_uri_to_tree` to return the resolved tree only when the built URI exactly matches the passed URI. Add a few comments clarifying what the function is doing and use more descriptive variable names. Differential Revision: https://phabricator.services.mozilla.com/D146210 --HG-- extra : moz-landing-system : lando
- Loading branch information