summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* sync: fix --tags optionMike Frysinger2021-11-051-3/+2
| | | | | | | | | | | | This has been broken since it was added where --tags was actually the same as --no-tags. Oddly, it was copied from init where the logic is correct. Bug: https://crbug.com/gerrit/12401 Change-Id: I15b89da1a655176a11bebc22573b25c728055328 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/322955 Reviewed-by: Andrew Lamb <andrewlamb@google.com> Tested-by: Mike Frysinger <vapier@google.com>
* project: fix format string in error messageLaMont Jones2021-11-051-1/+1
| | | | | | | | | BUG=None Change-Id: I0b195fd919c6db8cb3547e8d6f4c733f2bd4a535 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/322735 Tested-by: LaMont Jones <lamontjones@google.com> Reviewed-by: Xin Li <delphij@google.com>
* superproject: added 'implies -c' in the help of --use-superproject option.Raman Tenneti2021-11-012-3/+2
| | | | | | | | | | | | | | sync.py: deleted unused import errno. Tested: $ ./run_tests $ flake8 repo subcmds/sync.py Bug: https://crbug.com/gerrit/15208 Change-Id: I2bb3098f5602ded3861e000100766041ad93b53d Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/322555 Reviewed-by: Mike Frysinger <vapier@google.com> Tested-by: Raman Tenneti <rtenneti@google.com>
* Support more url schemes for getting standalone manifestv2.17.3Matt Story2021-10-271-4/+4
| | | | | | | | | | | urllib.requests.urlopen also supports file, so call it unless the scheme is 'gs'. This adds http, https, and ftp support. Change-Id: I3f215c3ebd8e6dee29ba14c7e79ed99d37287109 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/322095 Reviewed-by: Michael Kelly <mkelly@arista.com> Reviewed-by: Mike Frysinger <vapier@google.com> Tested-by: Matt Story <mstory@arista.com>
* fetch: Fix stderr handling for gsutilJack Neus2021-10-262-4/+8
| | | | | | | | | | | | | | | | | Previously gsutil stderr was getting piped into stdout, which yields bad results if there are non-fatal warnings in stderr. Additionally, we should fail outright if gsutil fails (by adding `check = True`) rather than fail later on when we try to sync to a manifest that is in fact just a stderr dump. BUG=none TEST=manual runs with bad gs urls Change-Id: Id71791d0c3f180bd0601ef2c783a8e8e4afa8f59 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/321935 Tested-by: Jack Neus <jackneus@google.com> Reviewed-by: Mike Frysinger <vapier@google.com>
* ssh: handle FileNotFoundError errorsMike Frysinger2021-10-261-0/+3
| | | | | | | | | | If ssh isn't installed, it throws a distinct error we have to catch. Bug: https://crbug.com/gerrit/15196 Change-Id: I0660e842c304ce7575f5cb100894d05fd65f9454 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/322055 Reviewed-by: Jack Neus <jackneus@google.com> Tested-by: Mike Frysinger <vapier@google.com>
* sync: properly handle standalone manifests for `sync` commandv2.17.2Jack Neus2021-10-151-2/+4
| | | | | | | | | | | | | | sync should not attempt to sync the manifest project if it was created from a standalone manifest. The current work around is to run sync with --nmu. BUG=none TEST=manual runs Change-Id: I2e121af0badf9642143e77c7af89d1c2d993b0f3 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/321195 Tested-by: Jack Neus <jackneus@google.com> Reviewed-by: Mike Frysinger <vapier@google.com>
* subcmds/sync: Use pack-refs instead of gc for redundant gitdirs.Allen Webb2021-10-141-10/+24
| | | | | | | | | | | | | Previously `git gc` was being run on every gitdir even when they shared the same objects. Instead only call it once and use pack-refs for the gitdirs that were not gc'ed. Bug: https://crbug.com/gerrit/15113 Test: repo sync -j # and check that git pack-refs is called Change-Id: Icff37ab3ec78cfb44391d8cc7f2d875991532320 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/320275 Tested-by: Allen Webb <allenwebb@google.com> Reviewed-by: Mike Frysinger <vapier@google.com>
* repo: more arg checking for --standalone-manifest re-initsv2.17.1Jack Neus2021-10-111-0/+5
| | | | | | | | | | | | | | | | `repo init` doesn't do anything on re-init when the checkout has been initialized using --standalone manifest. Rather than let the tool run through its existing flows (which happen to noop), check the args and explicitly quit if a bare `repo init` is run on a standalone checkout. BUG=none TEST=manual tests Change-Id: Ie4346ef6df1282ec3e3f8045a08138c93653fece Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/320735 Tested-by: Jack Neus <jackneus@google.com> Reviewed-by: Mike Frysinger <vapier@google.com>
* repo: fix bug with --standalone-manifestJack Neus2021-10-111-2/+4
| | | | | | | | | | | | | We were accidentally always setting manifest.standlone in config, which was messing up behavior for standard use cases. BUG=gerrit:15160 TEST=manual runs Change-Id: Ic80f084ae97de5721aced3bb52d3ea9115f8d833 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/320715 Tested-by: Jack Neus <jackneus@google.com> Reviewed-by: Mike Frysinger <vapier@google.com>
* sign-launcher: make the help text more automaticMike Frysinger2021-10-061-7/+28
| | | | | | | | | | | | | | | | Rather than display "3.0" all the time and confuse people, extract the version from the launcher we're signing and display that. Also reformat the text to follow our current practice: upload the versioned launcher by itself first, and then later copy that over the default. And while we're here, add tips for rollbacks. Change-Id: I1654425c88e5c67d78879f2f33ad685c59be14dc Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/319637 Reviewed-by: Xin Li <delphij@google.com> Tested-by: Mike Frysinger <vapier@google.com>
* subcmds/sync: Disable autoDetach for git gc.Allen Webb2021-10-051-0/+1
| | | | | | | | | | | | | | | gc.autoDetach is enabled by default which makes 'git gc --auto' return immediately and run in background. This can lead to a pile up of operations all using large amounts of memory at the same time. To avoid this set gc.autoDetach to false so that the garbage collect task waits for instances to finish before spawning more. Bug: https://crbug.com/gerrit/15113 Test: repo sync -j # and check the number of 'git gc' processes Change-Id: Ic0815156ba3db03972968f33f6f9f51e4928f23b Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/319835 Tested-by: Allen Webb <allenwebb@google.com> Reviewed-by: Mike Frysinger <vapier@google.com>
* git_config: Fixed test.gitconfig getting updated when running tests.v2.17Raman Tenneti2021-09-302-29/+19
| | | | | | | | | | | | | | | | | | Moved test_GetSyncAnalysisStateData to GitConfigReadWriteTests class. Deleted [repo "syncstate*..] data from tests/fixtures/test.gitconfig. Tested: ./run_tests ... tests/test_git_config.py::GitConfigReadWriteTests::test_GetSyncAnalysisStateData PASSED [ 84%] ... Bug: https://crbug.com/gerrit/15103 Change-Id: I8cb89ce10b025994a045106c9c66dd243ae8ba50 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/319557 Tested-by: Raman Tenneti <rtenneti@google.com> Reviewed-by: Mike Frysinger <vapier@google.com>
* Merge "Merge history of v2.14.5." into mainMike Frysinger2021-09-300-0/+0
|\
| * Merge history of v2.14.5.Mike Frysinger2021-09-300-0/+0
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The v2.14.[345] releases were cut on a branch based on v2.14.2. We had some regression fixes we wanted in v2.14, but too many risky changes landed in main since to cut another v2.14.x directly, and we didn't want to destabilize even more by pushing a v2.15 right away. So we branched to keep things healthy. But people with old checkouts trying to upgrade from those versions run into an old repo bug where it only selfupdates with fast-forwards, and repo can't fast-forward from those divergent histories. So let's do a merge commit to stitch the history back together. There's no actual changes in here. Change-Id: I05a96048e3846321e57c5f5224fb8dcf3c191d35
| | * sync: fix recursive fetchingv2.14.5Mike Frysinger2021-05-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit b2fa30a2b891b22c173c960a67bf38ccbba8de1b ("sync: switch network fetch to multiprocessing") accidentally changed the variable passed to the 2nd fetch call from |missing| to |to_fetch| due to a copy & paste of the earlier changed logic. Undo that to fix git submodule fetching. Bug: https://crbug.com/gerrit/14489 Change-Id: I627954f80fd2e80d9d5809b530aa6b0ef9260abb Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/305262 Reviewed-by: Raman Tenneti <rtenneti@google.com> Tested-by: Mike Frysinger <vapier@google.com>
| | * git_config: hoist Windows ssh check earlierv2.14.4Mike Frysinger2021-05-041-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The ssh master logic has never worked under Windows which is why this code always returned False when running there (including cygwin). But the OS check was still done while holding the threading lock. While it might be a little slower than necessary, it still worked. The switch from the threading module to the multiprocessing module changed global behavior subtly under Windows and broke things: the globals previously would stay valid, but now they get cleared. So the lock is reset to None in children workers. We could tweak the logic to pass the lock through, but there isn't much point when the rest of the code is still disabled in Windows. So perform the platform check before we grab the lock. This fixes the crash, and probably speeds things up a few nanoseconds. This shouldn't be a problem on Linux systems as the platform fork will duplicate the existing process memory (including globals). Bug: https://crbug.com/gerrit/14480 Change-Id: I1d1da82c6d7bd6b8cdc1f03f640a520ecd047063 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/305149 Reviewed-by: Raman Tenneti <rtenneti@google.com> Tested-by: Mike Frysinger <vapier@google.com>
| | * sync: fix print error when handling server errorv2.14.3Mike Frysinger2021-05-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When converting this logic from print() to the output buffer, this error codepath should have dropped the use of the file= redirect. Bug: https://crbug.com/gerrit/14482 Change-Id: Ib484924a2031ba3295c1c1a5b9a2d816b9912279 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/305142 Reviewed-by: Raman Tenneti <rtenneti@google.com> Tested-by: Mike Frysinger <vapier@google.com>
* | | Merge history of v1.13.11.Xin Li2021-09-300-0/+0
|\ \ \ | |/ / |/| | | | | | | | | | | | | | | | | | | | For older versions of repo, this would make it easier for it to perform a self update by making it a fast-forward from the following tags: v1.13.9.2, v1.13.9.3, v1.13.9.4, v1.13.10, v1.13.11 Change-Id: Ia75776312eaf802a150db8bd7c0a6dce57914580
| * | Revert "Save cookies back to jar when fetching clone.bundle"v1.13.11repo-1maintMike Frysinger2020-02-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 4abf8e6ef81e78469148b156ae2d2da70ace627a. The curl process for updating the cookie file is not atomic. When fetching many bundles in parallel, we can sometimes corrupt the file causing it to be cleared. Since users should manage gitcookies on their own, leave it read-only. Bug: https://crbug.com/gerrit/12300 Change-Id: Id472c99b197bc4cf8533c649f8881509f38643c1 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/254092 Reviewed-by: David Pursehouse <dpursehouse@collab.net> Tested-by: Mike Frysinger <vapier@google.com> (cherry picked from commit dc1d0e0c7fffa5109048ac52a67aa97bb362ae3a)
| * | repo: bump launcher versionMike Frysinger2020-02-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | This way we can push out the updated stable branch change. Change-Id: I72d5dab4523a10dfeb6529796892096aa80eba3c Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/254492 Reviewed-by: David Pursehouse <dpursehouse@collab.net> Tested-by: Mike Frysinger <vapier@google.com>
| * | project: fix bytes/str encoding when updating git submodulesMike Frysinger2020-02-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since tempfile.mkstemp() returns a file handle in binary mode, make sure we turn our strings into bytes before writing. Bug: https://crbug.com/gerrit/12043 Change-Id: I3e84d595e84b8bc12a1fbc7fd0bb3ea0ba2832b0 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/254393 Reviewed-by: Michael Mortensen <mmortensen@google.com> Reviewed-by: Mike Frysinger <vapier@google.com> Tested-by: Mike Frysinger <vapier@google.com> (cherry picked from commit 163d42eb43ba79677aae22fa859896010badba9b)
| * | repo: allow REPO_REV to be an env varMike Frysinger2020-02-111-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We do this for REPO_URL already. Bug: https://crbug.com/gerrit/10233 Change-Id: I53410645474b00d900467c96fa5d8446f3a607d3 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/253552 Reviewed-by: David Pursehouse <dpursehouse@collab.net> Tested-by: Mike Frysinger <vapier@google.com> (cherry picked from commit 563f1a651298eaa3616f92c3cd7b264fe5442379)
| * | Fixing forall subcommand for Py3v1.13.10Jiri Tyr2020-02-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Execution of 'repo forall -p -c' doesn't work with Py3 and ends up with an error: Got an error, terminating the pool: TypeError: can only concatenate str (not "bytes") to str That's fixed by using the decode() method. Change-Id: Ice01aaa1822dde8d957b5bf096021dd5a2b7dd51 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/253659 Reviewed-by: Mike Frysinger <vapier@google.com> Reviewed-by: David Pursehouse <dpursehouse@collab.net> Tested-by: Jiri Tyr <jiri.tyr@gmail.com> (cherry picked from commit 83a3227b62c936b346b825b333fc2ca65528ecfd)
| * | remove spurious +x bitsMike Frysinger2020-02-103-0/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These files are not directly executable, so drop the +x bits. Change-Id: Iaf19a03a497686cc21103e7ddf08073173440dd1 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/254076 Tested-by: Mike Frysinger <vapier@google.com> Reviewed-by: David Pursehouse <dpursehouse@collab.net> (cherry picked from commit e7c91889a6ff23931d3fbc25481b276e50ed8229)
| * | find python via envMike Frysinger2020-02-102-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows these scripts to run through the active version of the virtualenv python when invoked via tox. Change-Id: Ib52f475b7b20c34d62cfd179a1341da1a08a8b5c Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/253974 Reviewed-by: David Pursehouse <dpursehouse@collab.net> Tested-by: Mike Frysinger <vapier@google.com> (cherry picked from commit 1b117db767804856a310210c012fdd40addae66a)
| * | git_config: fix encoding handling in GetUrlCookieFileMike Frysinger2020-02-101-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make sure we decode the bytes coming from the subprocess.Popen as we're treating them as strings. Change-Id: I44100ca5cd94f68a35d489936292eb641006edbe Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/253973 Reviewed-by: Jonathan Nieder <jrn@google.com> Tested-by: Mike Frysinger <vapier@google.com> (cherry picked from commit ded477dbb9c6993cbe8b93b10654682b04fdeea8)
| * | Fix inverted logic around [gitc-]init and -cv1.13.9.4Dan Willemsen2020-02-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of not using '-c' for '--current-branch' when using gitc, we were only using '-c' when using gitc, so we still had the conflict with the gitc option, and other users still couldn't use '-c'. Test: repo init -u https://android.googlesource.com/platform/manifest; repo init -c Test: repo gitc-init -u ... -b ... -c testing Change-Id: I71e4950a49c281418249f0783c6a2ea34f0d3e2b Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/253795 Reviewed-by: Mike Frysinger <vapier@google.com> Tested-by: Dan Willemsen <dwillemsen@google.com> (cherry picked from commit 93293ca47f3a898b30eecf21e7b4e1038780c867)
| * | Do not try to fetch default revision for mirrors alwaysv1.13.9.3Chirayu Desai2020-02-061-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Mirrors may contain multiple projects, some of which may not always contain the default revision. * Only fetch the default revision explicitly if '--current-branch' is set. * Fixes breakage casued by commit 6856f98467aa5c98085cdee02587dbab984cebb1 "Fix repo mirror with --current-branch" Bug: https://crbug.com/gerrit/12274 Change-Id: Iaafabe2992f76f3644b841f24245d3e19c9515a9 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/253093 Reviewed-by: Kuang-che Wu <kcwu@chromium.org> Reviewed-by: Mike Frysinger <vapier@google.com> Tested-by: Chirayu Desai <chirayudesai1@gmail.com> (cherry picked from commit f7b64e3350a622ee87e1927cdbc8d854a5696d85)
| * | init: handle -c conflicts with gitc-initv1.13.9.2Mike Frysinger2020-02-052-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We keep getting requests for init to support -c. This conflicts with gitc-init which allocates -c for its own use. Lets make this dynamic so we keep it with "init" but omit it for "gitc-init". Bug: https://crbug.com/gerrit/10200 Change-Id: Ibf69c2bbeff638e28e63cb08926fea0c622258db (cherry picked from commit 66098f707a1a3f352aac4c4bb2c4f88da070ca2a) Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/253392 Tested-by: Mike Frysinger <vapier@google.com> Reviewed-by: Mike Frysinger <vapier@google.com>
| * | repo: point default branch to repo-1Mike Frysinger2020-02-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since this will be feature-frozen for Python 2 users, lets point the default update branch to "repo-1" rather than "stable" as the latter will follow the master development (and Python 3-only). Bug: https://crbug.com/gerrit/10418 Change-Id: Iceff0983684a580dc5c9ec1c60acfb5eda5ce2c4 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/253172 Reviewed-by: David Pursehouse <dpursehouse@collab.net> Tested-by: Mike Frysinger <vapier@google.com>
* | | trace2_event: Add remove_prefix to fix failing tests on Linux & macOS.Raman Tenneti2021-09-291-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | removeprefix is available i python 3.9. Mac and Linux are running in a version below 3.9. Thus tests are failing with the following error: "AttributeError: 'str' object has no attribute 'removeprefix' " Replaced the removeprefix with custom function which we will delete once Linux and macOS versions are updated. Tested: $ ./run_tests Bug: [google internal] b/201453085 Change-Id: I9b4d564ff1176e1b4471805ef05472c1914cd9f9 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/319375 Tested-by: Raman Tenneti <rtenneti@google.com> Reviewed-by: Mike Frysinger <vapier@google.com>
* | | git_config: update error handling with no config fileMike Frysinger2021-09-291-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that _do throws an exception when `git` fails, update the logic that tries to read config files but the file doesn't exist. Bug: b/192664812 Change-Id: I6417ecd70891b8f2d5f2bdb819f91df69ac4b70c Test: `repo upload` no longer crashes when .repo/config doesn't exist Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/319295 Reviewed-by: Jack Neus <jackneus@google.com> Tested-by: Mike Frysinger <vapier@google.com>
* | | launcher: bump version for new releaseMike Frysinger2021-09-281-1/+1
| | | | | | | | | | | | | | | | | | | | | Change-Id: I9812185c9dfc11289547f5956c0cbe567d720f7f Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/319335 Reviewed-by: Xin Li <delphij@google.com> Tested-by: Mike Frysinger <vapier@google.com>
* | | Update revisionId if required when using extend-projectMichael Kelly2021-09-282-13/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a hard revision ID is provided in a regular project tag then the revisionId is updated as well if it is a commit hash. The difference is that if the revisionExpr is a commit, git-repo needs to update refs/remotes/m/master with update-ref not symbolic-ref, as the latter must refer to another ref, not to a specific commit. Change-Id: I215a62dabb30225e480ad2c731416d775fc0c750 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/310963 Tested-by: Michael Kelly <mkelly@arista.com> Reviewed-by: Mike Frysinger <vapier@google.com>
* | | Add 'dest-path' to extend-project to support changing pathMichael Kelly2021-09-284-17/+85
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows us to move the repository to a new location in the source tree without having to remove-project + add a new project tag. Change-Id: I4dba6151842e57f6f2b8fe60cda260ecea68b7b4 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/310962 Reviewed-by: Mike Frysinger <vapier@google.com> Tested-by: Michael Kelly <mkelly@arista.com>
* | | superproject: Only trigger enrollment logic when manifest have it.Xin Li2021-09-281-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current code would check for enrollment status when the user did not explicitly specify --[no-]use-superproject and do not have a remembered value in their repo client. However, because superproject only makes sense for manifests that have one specified, we should skip the enrollment logic in that case. Address this by checking manifest.superproject prior to proceeding. This would avoid showing the greeting message of superproject enrollment which can be confusing for developers. Tested: For manifest without superproject: - repo sync --use-superproject will still show message for superproject; - repo sync will not show message regardless of enrollment state For manifest with superproject: - repo sync will show message and perform enrollment if not previously enrolled Bug: https://crbug.com/gerrit/15039 Change-Id: Ic2be9f9d037f0e7cf3446da474a5a0d0e4bd88da Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/319255 Tested-by: Xin Li <delphij@google.com> Reviewed-by: Raman Tenneti <rtenneti@google.com> Reviewed-by: Mike Frysinger <vapier@google.com>
* | | superproject: Log syncstate's parameter as data-json it it is an array.Raman Tenneti2021-09-282-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | All the values of syncstate are strings, check the first byte and last byte to see if it is an array. For syncstate data, there were no false positives. Tested: $ repo_dev sync Verified event logged for argv is "data-json". $./run_tests Bug: [google internal] b/201102002 Change-Id: Id56adb532b80267f08d09147ac663cdd5987ce87 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/319075 Reviewed-by: Mike Frysinger <vapier@google.com> Tested-by: Raman Tenneti <rtenneti@google.com>
* | | make file removal a bit more robustMike Frysinger2021-09-286-51/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some of the file removal calls are subject to race conditions (if something else deletes the file), so extend our remove API to have an option to ignore ENOENT errors. Then update a bunch of random call sites to use this new functionality. Change-Id: I31a9090e135452033135337a202a4fc2dbf8b63c Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/319195 Reviewed-by: Sean McAllister <smcallis@google.com> Tested-by: Mike Frysinger <vapier@google.com>
* | | repo: add support for reading standalone manifests from diskJack Neus2021-09-281-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | BUG=b:192664812 TEST=existing tests (no coverage), manual runs Change-Id: Ic032417ecfca77d5e0de1b1ff62b30ce8205bfc5 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/318715 Tested-by: Jack Neus <jackneus@google.com> Reviewed-by: Mike Frysinger <vapier@google.com>
* | | repo: Add support for standalone manifestsJack Neus2021-09-287-18/+132
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added --standalone_manifest to repo tool. If set, the manifest is downloaded directly from the appropriate source (currently, we only support GS) and used instead of creating a manifest git checkout. The manifests.git repo is still created to keep track of various config but is marked as being for a standalone manifest so that the repo tool doesn't try to run networked git commands in it. BUG=b:192664812 TEST=existing tests (no coverage), manual runs Change-Id: I84378cbc7f8e515eabeccdde9665efc8cd2a9d21 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/312942 Tested-by: Jack Neus <jackneus@google.com> Reviewed-by: Mike Frysinger <vapier@google.com>
* | | superproject: Log argv parameter of syncstate as 'data-json'.Raman Tenneti2021-09-272-5/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed: "we need to make a special case for logging the argv; it should probably be a "data-json" event so that we log this directly as an array rather than an encoded string. Tested: $ repo_dev sync Verified event logged for argv is "data-json". $./run_tests Bug: [google internal] b/201102002 Change-Id: I18ccec79c73c8dc931cb8afc472b2361db8aea4c Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/319055 Reviewed-by: Josh Steadmon <steadmon@google.com> Reviewed-by: Xin Li <delphij@google.com> Tested-by: Raman Tenneti <rtenneti@google.com>
* | | Fix indent error which would have prevented choice expiration to work.Xin Li2021-09-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I077e05eea23ad58d1dde2c9fe5608660a56d03e5 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/318815 Tested-by: Xin Li <delphij@google.com> Reviewed-by: Amith Dsouza <amithds@google.com> Reviewed-by: Raman Tenneti <rtenneti@google.com>
* | | superproject: support a new revision attribute.Xin Li2021-09-275-15/+90
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Tested: $ ./run_tests Verified that a manifest that specified superproject revision would use the specified revision, and superproject will use the default revision. Note that this is a slight behavior change from earlier repo versions, which would always use the branch name of the manifest itself. However, the new behavior would be more consisitent with regular "project" element and would allow superproject be used even if it is not enabled for the particular manifest branch, so we have decided to make the change as it would provide more flexibility and better matches what other elements would do. Bug: [google internal] b/187868160 Change-Id: I35255ee347aff6e65179f7879d52931f168b477e Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/317643 Tested-by: Xin Li <delphij@google.com> Reviewed-by: Raman Tenneti <rtenneti@google.com> Reviewed-by: Mike Frysinger <vapier@google.com>
* | | release-process: update distro baseline & add OpenSSHMike Frysinger2021-09-241-61/+108
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Stop tracking Ubuntu Trusty & Xenial and Debian Jessie & Stretch as they only had Python 3.5 available which we've dropped. Backfill OpenSSH versions since we've started testing for it. Change-Id: I03183ed97f6e43dce8a00e36cce2956544a26afc Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/318835 Reviewed-by: Jack Neus <jackneus@google.com> Reviewed-by: Mike Frysinger <vapier@google.com> Tested-by: Mike Frysinger <vapier@google.com>
* | | platform_utils: os.rename exception when src and des on different file systemwenchiching2021-09-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Symptom: repo sync exception Root Cause: os.rename only works when source and destination are on the same file system Solution: using shutil.move to save disk usage, I create links for projects and project-objects, link to folder on another disk lrwxrwxrwx 1 owenwen owenwen 47 Jun 9 16:40 project-objects -> /disk3/AndroidLocalRepos/.repo/project-objects/ lrwxrwxrwx 1 owenwen owenwen 40 Jun 9 16:40 projects -> /disk3/AndroidLocalRepos/.repo/projects/ below are exception I met: """ Traceback (most recent call last): File "/usr/lib/python3.6/multiprocessing/pool.py", line 119, in worker result = (True, func(*args, **kwds)) File "/usr/lib/python3.6/multiprocessing/pool.py", line 44, in mapstar return list(map(*args)) File "/disk2/Android11/.repo/repo/subcmds/sync.py", line 550, in _CheckoutOne project.Sync_LocalHalf(syncbuf, force_sync=force_sync) File "/disk2/Android11/.repo/repo/project.py", line 1251, in Sync_LocalHalf self._InitWorkTree(force_sync=force_sync, submodules=submodules) File "/disk2/Android11/.repo/repo/project.py", line 2801, in _InitWorkTree self._CheckDirReference(self.gitdir, dotgit, share_refs=True) File "/disk2/Android11/.repo/repo/project.py", line 2674, in _CheckDirReference platform_utils.rename(dst_path, src_path) File "/disk2/Android11/.repo/repo/platform_utils.py", line 127, in rename os.rename(src, dst) OSError: [Errno 18] Invalid cross-device link: '/disk2/Android11/system/libhidl/.git/packed-refs' -> '/disk2/Android11/.repo/projects/system/libhidl.git/packed-refs' """ Change-Id: Ifda2f16530cc5a8f280169f482ee858f9e5241d3 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/316002 Tested-by: Mike Frysinger <vapier@google.com> Reviewed-by: Mike Frysinger <vapier@google.com>
* | | manifest: make repo-hooks more robust wrt element orderingJack Neus2021-09-232-23/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, repo will fail to sync to a manifest if the definition of the repo-hooks project comes after the repo-hooks element. BUG=none TEST=new test, run_tests Change-Id: I0bf85625173492af6c6404d4b67543e96e670562 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/318520 Reviewed-by: Mike Frysinger <vapier@google.com> Tested-by: Jack Neus <jackneus@google.com>
* | | update-manpages: avoid regen just for datestamp updateMike Frysinger2021-09-221-5/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To avoid noise due to the passage of time, don't regenerate man pages if the only thing different is the datestamp in the header. Change-Id: Ic8d7b08d12e59c66994c0cc2d4ec2d2ed3eb6e6d Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/318575 Reviewed-by: Jack Neus <jackneus@google.com> Reviewed-by: Mike Frysinger <vapier@google.com> Tested-by: Mike Frysinger <vapier@google.com>
* | | superproject: Move enrollment to opt-out when enabled globallyv2.16.8Xin Li2021-09-201-36/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Our internal experiments was a success so far and we are enrolling 100% users now. Instead of asking every two weeks, simply consider a lack of unexpired choice as accepting the system default. With this change the user would still be able to override the system default with --no-use-superproject, or to permanently set the choice in user's profile with git config --global repo.superprojectchoice. Bug: [google internal] b/190688390 Change-Id: Idc77a9cbf88a169d90304169e91f0d722dc4ac8b Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/317975 Tested-by: Xin Li <delphij@google.com> Reviewed-by: Raman Tenneti <rtenneti@google.com>
* | | superproject: Log branch and remote url with every log message.Raman Tenneti2021-09-161-14/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Saved superproject's remote URL in _remote_url data and used it in the _Fecth function. Tested: $ ./run_tests $ flake8 git_superproject.py $ repo_dev init --use-superproject -u https://android.googlesource.com/platform/manifest $ repo_dev sync Verified the all log messages have the following format. repo superproject branch: <branch> url: <url> warning: <message> Bug: [google internal] b/200072098 Change-Id: Iac6af7c99225479fd50bc6909396b22e0ce5f76b Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/318177 Reviewed-by: Xin Li <delphij@google.com> Tested-by: Raman Tenneti <rtenneti@google.com>