summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* ssh: Print details if running the command failsv2.44Sebastian Schuberth2024-03-111-2/+6
| | | | | | | | | Change-Id: I87adbdd5fe4eb2709c97ab4c21b414145acf788b Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com> Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/392915 Reviewed-by: Mike Frysinger <vapier@google.com> Reviewed-by: Tuan Vo Hung <vohungtuan@gmail.com> Commit-Queue: Josip Sokcevic <sokcevic@google.com>
* upload: Fix patchset description destinationJosip Sokcevic2024-03-081-0/+1
| | | | | | | | | Bug: 308467447 Change-Id: I8ad598d39f5fdb24d549d3277ad5fedac203581b Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/412477 Reviewed-by: George Engelbrecht <engeg@google.com> Tested-by: Josip Sokcevic <sokcevic@google.com> Commit-Queue: Josip Sokcevic <sokcevic@google.com>
* sync: Fix sorting for nested projectsJosip Sokcevic2024-03-082-13/+42
| | | | | | | | | | | | | | | | | | | The current logic to create checkout layers doesn't work in all cases. For example, let's assume there are three projects: "foo", "foo/bar" and "foo-bar". Sorting lexicographical order is incorrect as foo-bar would be placed between foo and foo/bar, breaking layering logic. Instead, we split filepaths based using path delimiter (always /) and then use lexicographical sort. BUG=b:325119758 TEST=./run_tests, manual sync on chromiumos repository Change-Id: I76924c3cc6ba2bb860d7a3e48406a6bba8f58c10 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/412338 Tested-by: Josip Sokcevic <sokcevic@google.com> Commit-Queue: Josip Sokcevic <sokcevic@google.com> Reviewed-by: George Engelbrecht <engeg@google.com>
* sync: introduce --force-checkoutv2.43Josip Sokcevic2024-03-072-5/+31
| | | | | | | | | | | | | | In some cases (e.g. in a CI system), it's desirable to be able to instruct repo to force checkout. This flag passes --force flag to `git checkout` operations. Bug: b/327624021 Change-Id: I579edda546fb8147c4e1a267e2605fcf6e597421 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/411518 Commit-Queue: Josip Sokcevic <sokcevic@google.com> Reviewed-by: Gavin Mak <gavinmak@google.com> Reviewed-by: George Engelbrecht <engeg@google.com> Tested-by: Josip Sokcevic <sokcevic@google.com>
* upload: Add support for setting patchset descriptionSergiy Belozorov2024-03-043-0/+48
| | | | | | | | | Bug: 308467447 Change-Id: I7abcbc98131b826120fc9ab85d5b889f90db4b0a Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/355968 Tested-by: Sergiy Belozorov <sergiyb@chromium.org> Reviewed-by: Mike Frysinger <vapier@google.com> Commit-Queue: Sergiy Belozorov <sergiyb@chromium.org>
* sync: Introduce git checkout levelsv2.42Josip Sokcevic2024-02-272-9/+81
| | | | | | | | | | | | | | | | | | | | | If a repo manifest is updated so that project B is placed within a project A, and if project A had content in new B's location in the old checkout, then repo sync could break depending on checkout order, since B can't be checked out before A. This change introduces checkout levels which enforces right sequence of checkouts while still allowing for parallel checkout. In an example above, A will always be checked out first before B. BUG=b:325119758 TEST=./run_tests, manual sync on ChromeOS repository Change-Id: Ib3b5e4d2639ca56620a1e4c6bf76d7b1ab805250 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/410421 Tested-by: Josip Sokcevic <sokcevic@google.com> Reviewed-by: Greg Edelston <gredelston@google.com> Commit-Queue: Josip Sokcevic <sokcevic@google.com> Reviewed-by: Gavin Mak <gavinmak@google.com>
* git_command: Return None from GetEventTargetPath() if set to empty stringPeter Collingbourne2024-02-261-0/+2
| | | | | | | | | | | | If trace2.eventTarget was set to the empty string, match git behavior and don't write a trace. Bug: 319673783 Change-Id: I02b3884ad97551f8a9d7363c2cbe6b0adee6f73e Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/410518 Reviewed-by: Josip Sokcevic <sokcevic@google.com> Commit-Queue: Josip Sokcevic <sokcevic@google.com> Tested-by: Peter Collingbourne <pcc@google.com>
* trace: Save trace2 sid in REPO_TRACE fileJosip Sokcevic2024-02-221-4/+7
| | | | | | | | | | | | | | git-trace2 events contain additional information what git is doing under the hood, and repo doesn't have visibility into. Instead of relying on timestamp information to match REPO_TRACE with git-trace2 events, add SID information into REPO_TRACE. Change-Id: I37672a3face81858072c7a3ce34ca3379199dab5 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/410280 Tested-by: Josip Sokcevic <sokcevic@google.com> Reviewed-by: Gavin Mak <gavinmak@google.com> Commit-Queue: Josip Sokcevic <sokcevic@google.com>
* subcmds: sync: Remove deprecated _AUTO_GCGreg Edelston2024-02-201-15/+0
| | | | | | | | | | | | | Opportunistic cleanup. It looks like this deprecated feature was slated for deletion nearly a year ago. Bug: None Test: ./run_tests Change-Id: I0bd0c0e6acbd1eaee1c0b4945c79038257d22f44 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/410198 Reviewed-by: Yiwei Zhang <yiwzhang@google.com> Commit-Queue: Greg Edelston <gredelston@google.com> Tested-by: Greg Edelston <gredelston@google.com>
* launcher: Set shebang to python3Josip Sokcevic2024-02-071-2/+2
| | | | | | | | | | | | | | | | | | | | Some (most?) Linux repos don't have /usr/bin/python, unless python-is-python3 is installed. While package owners can adjust shebang, we have seen an increase in number of bugs filed as extra steps are required. Per PEP-0394, python3 is acceptable and should be available if python3 is supported. We no longer support python2, and repo no longer works with python2, so this change makes that explicit. Bug: 40014585 Change-Id: I9aed90fd470ef601bd33bd596af3df69da69ef5d Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/407497 Commit-Queue: Josip Sokcevic <sokcevic@google.com> Reviewed-by: Jason Chang <jasonnc@google.com> Reviewed-by: Gavin Mak <gavinmak@google.com> Reviewed-by: Максим Паймушкин <maxim.paymushkin@gmail.com> Tested-by: Josip Sokcevic <sokcevic@google.com>
* sync: ensure RepoChangedException propagatedJason Chang2024-02-061-1/+1
| | | | | | | | | | | | | Prior to this change RepoChangedException would be caught and re-rasied as a different exception. This would prevent RepoChangedException handler from running in main.py Bug: b/323232806 Change-Id: I9055ff95d439d6ff225206c5bf1755cc718bcfcc Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/407144 Tested-by: Josip Sokcevic <sokcevic@google.com> Reviewed-by: Josip Sokcevic <sokcevic@google.com> Commit-Queue: Josip Sokcevic <sokcevic@google.com>
* stop passing project to UpdateManifestErrorYiwei Zhang2024-02-021-3/+1
| | | | | | | | | | | | | | | | | UpdateManifestError inherits from RepoExitError which inherits from BaseRepoError. None of them takes project as kwargs causing the error like "UpdateManifestError() takes no keyword arguments" in b/317183321 [1]: https://gerrit.googlesource.com/git-repo/+/449b23b698d7d4b13909667a49a0698eb495eeaa/error.py#144 Bug: b/317183321 Change-Id: I64c3dc502027f9dda56a0824f2712364b4502934 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/398997 Commit-Queue: Yiwei Zhang <yiwzhang@google.com> Tested-by: Yiwei Zhang <yiwzhang@google.com> Reviewed-by: Josip Sokcevic <sokcevic@google.com> Reviewed-by: Jason Chang <jasonnc@google.com>
* project: Rename if deletion failsv2.41Josip Sokcevic2024-01-251-10/+22
| | | | | | | | | | | | | If a project contains files not owned by the current user, remove will fail. In order to ensure repo sync continues to work, rename the affected project instead, and let user know about it. Bug: 321273512 Change-Id: I0779d61fc67042308a0226adea7d98167252a5d3 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/404372 Reviewed-by: Mike Frysinger <vapier@google.com> Tested-by: Josip Sokcevic <sokcevic@google.com> Commit-Queue: Josip Sokcevic <sokcevic@google.com>
* Clean up remaining `repo sync` log spam.Tomasz Wasilczyk2024-01-052-18/+23
| | | | | | | | | | | | | There are still some verbose messages (e.g. "remote: ...") when doing repo sync after a couple days. Let's hide them behind verbose flag. Bug: N/A Test: repo sync Change-Id: I1408472c95ed80d9555adfe8f92211245c03cf41 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/400855 Reviewed-by: Josip Sokcevic <sokcevic@google.com> Tested-by: Tomasz Wasilczyk <twasilczyk@google.com> Commit-Queue: Tomasz Wasilczyk <twasilczyk@google.com>
* docs: fix some grammar typosMike Frysinger2024-01-041-3/+2
| | | | | | | | Change-Id: Ie1a32cda67f94b0a2b3329b1be9e03dcbedf39cc Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/400917 Reviewed-by: Josip Sokcevic <sokcevic@google.com> Tested-by: Mike Frysinger <vapier@google.com> Commit-Queue: Mike Frysinger <vapier@google.com>
* project: Check references during syncJosip Sokcevic2024-01-031-1/+14
| | | | | | | | | | | | | | | Symbolic references need to be checked each time sync is called, not only for newly created repositories. For example, it is possible to change a project name to the already existing name, and that will result in a broken git setup without this patch: refs/ will still point to the old repository, whereas all objects will point to the new repository. Bug: 40013418 Change-Id: I596d29d182986804989f0562fb45090224549b0f Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/395798 Reviewed-by: Mike Frysinger <vapier@google.com> Tested-by: Josip Sokcevic <sokcevic@google.com> Commit-Queue: Josip Sokcevic <sokcevic@google.com>
* tests: setup user identity for testsVitalii Dmitriev2023-12-201-0/+9
| | | | | | | | | | | | | | | | | After a6413f5d a GitCommandError is raised. Since there were no user identity were set up, it fails: - ReviewableBranchTests from test_project.py - ResolveRepoRev and CheckRepoRev from test_wrapper.py Test: ./run_tests Change-Id: Id7f5772afe22c77fc4c8f8f0b8be1b627ed42187 Signed-off-by: Vitalii Dmitriev <vitalii.dmitriev@unikie.com> Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/398658 Reviewed-by: Mike Frysinger <vapier@google.com> Tested-by: Vitalii Dmitriev <dmit.vitalii@gmail.com> Commit-Queue: Vitalii Dmitriev <dmit.vitalii@gmail.com>
* manifest_xml: fix url normalization for inits and remotesVitalii Dmitriev2023-12-202-2/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Before the change, repo normalizes the urls with a following format only: git@github.com:foo/bar It doesn't cover the following case: <remote name="org" fetch="git@github.com:org/" /> <project name="somerepo" remote="org" /> Results to: error: Cannot fetch somerepo from ssh://git@github.com/org/git@github.com:org/somerepo Current change fixes it by normalizing this format: git@github.com:foo Test: ./run_tests tests/test_manifest_xml.py Change-Id: I1ad0f5df0d52c0b7229ba4c9a4db4eecb5c1a003 Signed-off-by: Vitalii Dmitriev <vitalii.dmitriev@unikie.com> Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/398337 Commit-Queue: Vitalii Dmitriev <dmit.vitalii@gmail.com> Tested-by: Vitalii Dmitriev <dmit.vitalii@gmail.com> Reviewed-by: Mike Frysinger <vapier@google.com>
* git_trace2: Add socket timeoutJosip Sokcevic2023-12-191-0/+3
| | | | | | | | | | | | | | repo blocks indefinitely until trace collector receives trace events, which is not desired. This change adds a fixed timeout to connect and send operations. It is possible that some events will be lost. repo logs any failed trace operation. Bug: b/316227772 Change-Id: I017636421b8e22ae3fcbab9e4eb2bee1d4fbbff4 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/398717 Tested-by: Josip Sokcevic <sokcevic@google.com> Commit-Queue: Josip Sokcevic <sokcevic@google.com> Reviewed-by: Jason Chang <jasonnc@google.com>
* manifest_xml: do not allow / before : in scp-like syntaxMike Frysinger2023-12-192-1/+12
| | | | | | | | | | | Since git doesn't treat these as ssh:// URIs, we shouldn't either. Bug: https://g-issues.gerritcodereview.com/issues/40010331 Change-Id: I001f49be30395187cac447d09cb5a6c29e95768b Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/398517 Tested-by: Mike Frysinger <vapier@google.com> Reviewed-by: Jason Chang <jasonnc@google.com> Commit-Queue: Mike Frysinger <vapier@google.com>
* repo: Drop reexec of python3 from check_python_version()Peter Kjellerstedt2023-12-151-28/+2
| | | | | | | | | | | | This simplifies check_python_version() since there is no point in trying to fall back to python3, as we are already running using some Python 3 interpreter. Change-Id: I9dfdd002b4ef5567e064d3d6ca98ee1f3410fd48 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/397759 Reviewed-by: Mike Frysinger <vapier@google.com> Tested-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Commit-Queue: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
* repo: Remove Python 2 compatibility codePeter Kjellerstedt2023-12-151-7/+3
| | | | | | | | Change-Id: I1f5c691bf94f255442eea95e59ddd93db6213ad8 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/397758 Reviewed-by: Mike Frysinger <vapier@google.com> Commit-Queue: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Tested-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
* repo: Remove a Python 2 related commentPeter Kjellerstedt2023-12-141-1/+0
| | | | | | | | | | | The EnvironmentError exception was changed to OSError in commit ae824fb2fc2770c84cc34c1956e4c76c8c972860. Change-Id: I1b4ff742af409ec848131e82900e885c9f089f0c Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/397757 Reviewed-by: Mike Frysinger <vapier@google.com> Tested-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Commit-Queue: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
* Don't log spam `repo sync` by defaultv2.40Tomasz Wasilczyk2023-12-082-14/+23
| | | | | | | | | | | | | | | Most times a repo sync after some time (week+) results in a bunch of messages, which are not very useful for average user: - discarding 1 commits - Deleting obsolete checkout. Bug: N/A Test: repo sync Change-Id: I881eab61f9f261e98f3656c09e73ddd159ce288c Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/397038 Reviewed-by: Josip Sokcevic <sokcevic@google.com> Commit-Queue: Josip Sokcevic <sokcevic@google.com> Tested-by: Tomasz Wasilczyk <twasilczyk@google.com>
* tox: Remove pylint timeoutJosip Sokcevic2023-12-081-3/+0
| | | | | | | | | | It's not a valid pylint config Change-Id: Ida480429a3a86637f26e9fc3a0d6fa2d225d952a Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/396921 Reviewed-by: Scott Lee <ddoman@google.com> Commit-Queue: Josip Sokcevic <sokcevic@google.com> Tested-by: Josip Sokcevic <sokcevic@google.com>
* Update commit-msg hookOrgad Shaneh2023-12-041-11/+18
| | | | | | | | | | | Modified in https://gerrit-review.googlesource.com/c/gerrit/+/394841. Change-Id: I381e48fbdb92b33454219dd9d945a1756e551a77 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/395577 Reviewed-by: Mike Frysinger <vapier@google.com> Tested-by: Orgad Shaneh <orgads@gmail.com> Commit-Queue: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Ernesto Rodriguez <guez30nesto@gmail.com>
* sync: Fix partial sync false positiveMatt Schulte2023-11-302-1/+39
| | | | | | | | | | | | | | | | | | | | | In the case of a project being removed from the manifest, and in the path in which the project used to exist, and symlink is place to another project repo will start to warn about partial syncs when a partial sync did not occur. Repro steps: 1) Create a manifest with two projects. Project a -> a/ and project b -> b/ 2) Run `repo sync` 3) Remove project b from the manifest. 4) Use `link` in the manifest to link all of Project a to b/ Bug: 314161804 Change-Id: I4a4ac4f70a7038bc7e0c4e0e51ae9fc942411a34 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/395640 Reviewed-by: Gavin Mak <gavinmak@google.com> Tested-by: Matt Schulte <matsch@google.com> Commit-Queue: Gavin Mak <gavinmak@google.com>
* repo: add repo main script's directory to PYTHONPATH.Duy Truong2023-11-291-0/+8
| | | | | | | | | | | | | | | | | | | Python 3.11 introduces PYTHONSAFEPATH and the -P flag which, if enabled, does not prepend the script's directory to sys.path by default. This breaks repo because main.py expects its own directory to be part of Python's import path. This causes problems with tools that add PYTHONSAFEPATH to python programs, most notably Bazel. We will simply prepend main.py's path to PYTHONPATH instead. Bug: 307767740 Change-Id: I94f3fda50213e450df0d1e2df6a0b8b597416973 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/391236 Tested-by: Duy Truong <duytruong@google.com> Commit-Queue: Mike Frysinger <vapier@google.com> Reviewed-by: Mike Frysinger <vapier@google.com>
* info: Handle undefined mergeBranchJosip Sokcevic2023-11-201-1/+3
| | | | | | | | | | | | When a repo client is initialized with --standalone-manifest, it doesn't have merge branch defined. This results in mergeBranch being None. Bug: b/308025460 Change-Id: Iebceac0976e5d3adab5300bd8dfc76744a791234 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/393716 Tested-by: Josip Sokcevic <sokcevic@google.com> Reviewed-by: Mike Frysinger <vapier@google.com> Commit-Queue: Josip Sokcevic <sokcevic@google.com>
* manifest_xml: support nested submanifestsGuillaume Micouin-Jorda2023-11-151-1/+1
| | | | | | | | | | | | | Change-Id: I58f91c6b0db631bb7f55164f41d11d3a349ac94f Signed-off-by: Guillaume Micouin-Jorda <gmicouin@netcourrier.com> Signed-off-by: Hadamik Stephan <Stephan.Hadamik@continental-corporation.com> Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/392020 Reviewed-by: Ben PUJOL <pujolbe@gmail.com> Reviewed-by: LaMont Jones <lamontjones@google.com> Tested-by: Roberto Prado <roberto.prado.c@gmail.com> Commit-Queue: Roberto Prado <roberto.prado.c@gmail.com> Tested-by: LaMont Jones <lamontjones@google.com> Reviewed-by: Roberto Prado <roberto.prado.c@gmail.com>
* repo_logging: Ensure error details are printedJosh Bartel2023-11-131-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | This updates RepoLogger.log_aggregated_errors to print out the error message the RepoExitError when there is not a list of aggregated errors. Previously it would log out: ======================================================================= Repo command failed: ManifestParseError This told us what class of error occurred but missed the helpful error message that developers put in the error. After this change it will now print out the error message: ======================================================================= Repo command failed: ManifestParseError error parsing manifest /path/to/manifest.xml: no element found: line 197, column 0 Change-Id: I4805540fddb5fa9171dbc8912becfa7fdfb1ba67 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/392614 Commit-Queue: Aravind Vasudevan <aravindvasudev@google.com> Tested-by: Joshua Bartel <josh.bartel@garmin.com> Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com>
* repo: Use the worktree when checking the repo rev.Jason R. Coombs2023-11-131-1/+1
| | | | | | | | | | | | | Avoids treating the operation as if it were acting on a bare repository, thereby triggering failures when the Git client is configured with `safe.bareRepository=explicit`. Repo doesn't actually use a bare repository, but pointing at the gitdir acts as if it had. Bug: 307559774 Change-Id: I2c142275b2726a59526729c0b2c54faf728f125d Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/391554 Commit-Queue: Jason R. Coombs <jaraco@google.com> Tested-by: Jason R. Coombs <jaraco@google.com> Tested-by: Emily Shaffer <emilyshaffer@google.com> Reviewed-by: Emily Shaffer <emilyshaffer@google.com> Reviewed-by: Mike Frysinger <vapier@google.com>
* git_superproject: tell git that superproject is bareEmily Shaffer2023-11-091-5/+7
| | | | | | | | | | | | | | | | | | | | | | The superproject is initialized as a bare repo in Superproject:_Init(). That means that later operations must treat it as a bare repository, specifying the gitdir and setting 'bare' appropriately when launching GitCommand()s. It's also OK not to specify cwd here because GitCommand() will drop cwd if bare == True anyways. With this change, it's possible to run `repo init` and `repo sync` with the Git config 'safe.bareRepository' set to 'explicit'. This config strengthens Git's security posture against embedded bare repository attacks like https://github.com/justinsteven/advisories/blob/main/2022_git_buried_bare_repos_and_fsmonitor_various_abuses.md. Bug: b/227257481 Change-Id: I954a64c6883d2ca2af9c603e7076fd83b52584e9 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/389794 Reviewed-by: Mike Frysinger <vapier@google.com> Tested-by: Jason R. Coombs <jaraco@google.com> Tested-by: Emily Shaffer <emilyshaffer@google.com> Reviewed-by: Emily Shaffer <emilyshaffer@google.com> Commit-Queue: Jason R. Coombs <jaraco@google.com>
* Correctly handle schema-less URIs for remote fetch URLMichael Kelly2023-11-082-13/+74
| | | | | | | | | | | | | | | | Currently we don't deal with schema-less URIs like `git@github.com:foo` at all resulting in a scenario where we append them to the manifest repo URL. In order to deal with this, we munge both the manifest URL and the fetch URL into a format we like and proceed with that. Bug: https://g-issues.gerritcodereview.com/issues/40010331 Change-Id: I7b79fc4ed276630fdbeb235b94e327b172f0879b Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/386954 Reviewed-by: Mike Frysinger <vapier@google.com> Tested-by: Michael Kelly <mkelly@arista.com> Commit-Queue: Mike Frysinger <vapier@google.com>
* main: Log ManifestParseError exception messagesLuK13372023-11-061-0/+2
| | | | | | | | | | This lets us see manifest parsing error messages again. Change-Id: I2d90b97cfb50e4520f79e75fa0d648c373b49e98 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/391477 Reviewed-by: Mike Frysinger <vapier@google.com> Commit-Queue: Łukasz Patron <priv.luk@gmail.com> Tested-by: Łukasz Patron <priv.luk@gmail.com>
* repo: Remove unreachable code.Jason R. Coombs2023-11-011-35/+4
| | | | | | | | Change-Id: I41371feb88c85e9da0656b9fab04057c22d1dcf4 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/391514 Tested-by: Jason R. Coombs <jaraco@google.com> Reviewed-by: Mike Frysinger <vapier@google.com> Commit-Queue: Jason R. Coombs <jaraco@google.com>
* cleanup: Update codebase to expect Python 3.6Jason R. Coombs2023-10-3133-225/+169
| | | | | | | | | | | - Bump minimum version to Python 3.6. - Use f-strings in a lot of places. Change-Id: I2aa70197230fcec2eff8e7c8eb754f20c08075bb Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/389034 Tested-by: Jason R. Coombs <jaraco@google.com> Reviewed-by: Mike Frysinger <vapier@google.com> Commit-Queue: Jason R. Coombs <jaraco@google.com>
* sync: PersistentTransport call parent initv2.39Daniel Kutik2023-10-251-0/+1
| | | | | | | | | | | | | | Found via pylint: W0231: __init__ method from base class 'Transport' is not called (super-init-not-called) Just fixed for code correctness and to avoid potential future bugs. Change-Id: Ie1e723c2afe65d026d70ac01a16ee7a40c149834 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/390676 Reviewed-by: Mike Frysinger <vapier@google.com> Tested-by: Daniel Kutik <daniel.kutik@lavawerk.com> Commit-Queue: Daniel Kutik <daniel.kutik@lavawerk.com>
* sync: TeeStringIO write should return intDaniel Kutik2023-10-241-1/+2
| | | | | | | | Change-Id: I211776a493cad4b005c6e201833e9700def2feb9 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/390657 Reviewed-by: Mike Frysinger <vapier@google.com> Commit-Queue: Daniel Kutik <daniel.kutik@lavawerk.com> Tested-by: Daniel Kutik <daniel.kutik@lavawerk.com>
* sync: Fix tracking of broken linksJason Chang2023-10-241-1/+0
| | | | | | | | | | Change-Id: Ice4f4cc745cbac59f356bd4ce1124b6162894e61 Bug: b/113935847 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/390434 Tested-by: Jason Chang <jasonnc@google.com> Reviewed-by: Josip Sokcevic <sokcevic@google.com> Reviewed-by: Mike Frysinger <vapier@google.com> Commit-Queue: Jason Chang <jasonnc@google.com>
* project: Speculative fix for project corruptionJosip Sokcevic2023-10-232-2/+11
| | | | | | | | | | | | | | | | When a new shared project is added to manifest, there's a short window where objects can be deleted that are used by other projects. To close that window, set preciousObjects during git init. For non-shared projects, repo should correct the state in the same execution instance. Bug: 288102993 Change-Id: I366f524535ac58c820d51a88599ae2108df9ab48 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/390234 Commit-Queue: Josip Sokcevic <sokcevic@google.com> Tested-by: Josip Sokcevic <sokcevic@google.com> Reviewed-by: Mike Frysinger <vapier@google.com>
* cleanup: convert exceptions to OSErrorJason R. Coombs2023-10-217-22/+19
| | | | | | | | | | | In Python 3, these exceptions were merged into OSError, so switch everything over to that. Change-Id: If876a28b692de5aa5c62a3bdc8c000793ce52c63 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/390376 Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com> Commit-Queue: Mike Frysinger <vapier@google.com> Tested-by: Mike Frysinger <vapier@google.com>
* cleanup: delete redundant "r" open modeJason R. Coombs2023-10-217-10/+10
| | | | | | | | Change-Id: I86ebb8c5a9dc3752e8a25f4b11b64c5be3a6429e Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/390375 Tested-by: Mike Frysinger <vapier@google.com> Commit-Queue: Mike Frysinger <vapier@google.com> Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com>
* cleanup: use new dict & set generator stylesJason R. Coombs2023-10-213-8/+8
| | | | | | | | Change-Id: Ie34ac33ada7855945c77238da3ce644f8a9f8306 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/390374 Tested-by: Mike Frysinger <vapier@google.com> Commit-Queue: Mike Frysinger <vapier@google.com> Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com>
* manifest_xml: Fix empty project list when DOCTYPE is presentChris Allen2023-10-202-1/+19
| | | | | | | | | | | | | | | When parsing the manifest XML, the code looks for a top level DOM node named "manifest". However, it doesn't check that it's an element type node so if there is also an XML document type declaration node present (which has the same name as the root element) then it selects the wrong node and hence you end up with no projects defined at all. Change-Id: I8d101caffbbc2a06e56136ff21302e3f09cfc96b Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/390357 Reviewed-by: Mike Frysinger <vapier@google.com> Tested-by: Chris Allen <chris.allen@arm.com> Commit-Queue: Chris Allen <chris.allen@arm.com>
* cleanup: leverage yield from in more placesJason R. Coombs2023-10-203-9/+5
| | | | | | | | Change-Id: I4f9cb27d89241d3738486764817b51981444a903 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/390274 Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com> Commit-Queue: Mike Frysinger <vapier@google.com> Tested-by: Mike Frysinger <vapier@google.com>
* git_config: GetBoolean should return boolDaniel Kutik2023-10-201-1/+1
| | | | | | | | | Test: tox Change-Id: Ifc0dc089deef5a3b396d889c9ebfcf8d4f007bf2 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/390360 Tested-by: Daniel Kutik <daniel.kutik@lavawerk.com> Reviewed-by: Mike Frysinger <vapier@google.com> Commit-Queue: Daniel Kutik <daniel.kutik@lavawerk.com>
* project: using --depth results in error when including submanifestsRoberto Vladimir Prado Carranza2023-10-202-2/+5
| | | | | | | | | | | Fix: https://issues.gerritcodereview.com/issues/40015442 Change-Id: I7fb6c50cf2e438b21181ce1a5893885f09b9ee2b Signed-off-by: Roberto Vladimir Prado Carranza <roberto.prado.c@gmail.com> Signed-off-by: Guillaume Micouin-Jorda <gmicouin@netcourrier.com> Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/385995 Commit-Queue: Mike Frysinger <vapier@google.com> Reviewed-by: Mike Frysinger <vapier@google.com> Reviewed-by: Jerome Couto <jerome.couto@renault.com>
* repo: drop Python 2 compat logicMike Frysinger2023-10-201-4/+1
| | | | | | | | | Bug: 302871152 Change-Id: Ie7a0219e7ac582cd25c2bc5fb530e2c03bcbcc6e Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/390034 Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com> Commit-Queue: Mike Frysinger <vapier@google.com> Tested-by: Mike Frysinger <vapier@google.com>
* delete Python 2 (object) compatMike Frysinger2023-10-2019-43/+43
| | | | | | | | | Bug: 302871152 Change-Id: I39636d73a6e1d69efa8ade74f75c5381651e6dc8 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/390054 Commit-Queue: Mike Frysinger <vapier@google.com> Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com> Tested-by: Mike Frysinger <vapier@google.com>