summaryrefslogtreecommitdiffstats
path: root/repo
Commit message (Collapse)AuthorAgeFilesLines
* Allow clobbering of existing tags from remote.v1.13.0Xin Li2018-12-101-1/+1
| | | | | Bug: 120778183 Change-Id: Id44e2b68abc410a3afd4e07a3c943b0936347e38
* init: --dissociate option to copy objects borrowed with --referenceNikolai Merinov2018-10-191-0/+3
| | | | | | | | | | | | | | | | | | | | | | "repo init --reference" has two purposes: to decrease bandwidth used at clone time, and to decrease disk usage afterward, by using the reference repositories as an alternate store of objects even after the clone. The downside is that it makes the borrowing repositories dependent on the reference repositories, so it is easy to end up with missing objects by mistake after a cleanup operation like "git gc". To prevent that, v2.3.0-rc0~30^2 (clone: --dissociate option to mark that reference is only temporary, 2014-10-14), "git clone" gained a --dissociate option that makes --reference reuse objects from the reference repository at clone time but copy them over instead of using the reference as an alternate. This is more straightforward to use than plain --reference, at the cost of higher disk usage. Introduce a --dissociate to "repo init" that brings the same benefits to repo. The option is simply passed on to "git clone". Change-Id: Ib50a549eb71e0a2b3e234aea57537923962a80d4
* Remove unused pylint suppressionsDavid Pursehouse2018-07-241-1/+1
| | | | | | | | | | | pylint is not used since bb5b1a0. The pyflakes cleanup mentioned in that commit has not been done, but given that this project is no longer being actively developed I don't think it's worth spending time doing it. Leaving the pylint suppressions causes confusion because it leads people to think that we are still using pylint. Change-Id: If7d9f280a0f408c780f15915ffdb80579ae21f69
* Merge "Flush stderr on Windows"Sebastian Schuberth2018-07-131-0/+4
|\
| * Flush stderr on WindowsSebastian Schuberth2018-07-131-0/+4
| | | | | | | | | | | | | | | | While on Linux stderr is unbuffered, it is buffered on Windows. Always flush stderr on Windows to ensure any error messages appear in the right order to ease diagnosing. Change-Id: I37300e384ecd3a51a321a48818f0114d6f3357a0
* | Fix the initial existence check for "repo"Sebastian Schuberth2018-07-131-4/+5
|/ | | | | | | | | | | | | | | | | | | Commit 27226e742d7e1a3d371531c19a3fdd91a4f9ab4a introduced a warning if "repo" is not part of the bootstrapped REPO_URL. However, that check was done too early, directly after the call to _Clone. As the _Clone function does not actually clone but it only initializes and fetches, the check needs to be moved to after the call to _Checkout. To reproduce, call repo init --no-clone-bundle --repo-branch=master -u https://android.googlesource.com/platform/manifest which will currently always show the (bogus) warning message. With this fix, the warning will only be shown if "repo" indeed does not exist. While at it, also slightly improve the code by using os.path.join(). Change-Id: Ied89e24231addabab6075005065748df1ffa74c4
* Ensure repo waits for child process to terminateRenaud Paquay2017-05-291-1/+5
| | | | | | | | | | See http://stackoverflow.com/questions/7004687/os-exec-on-windows: execv on Windows does not behave as on Linux, i.e. a new process is spawned and the parent process terminates right away, which makes the shell prompt come back too soon. Change-Id: I1f8d23208765988629f081e9b949c67cf71c08ae
* init: add --submodules to sync manifest submodulesMartin Kelly2017-05-231-0/+3
| | | | | | | | | | | | | | | | repo sync can sync submodules via the --fetch-submodules option. However, if the manifest repo has submodules, those will not be synced. Having submodules in the manifest repo -- while not commonly done -- can be useful for inheriting a manifest from another project using <include> and layering changes on top of it. In this way, you can avoid having to deal with merge conflicts between your own manifests and the other project's manifests (for example, if you're managing an Android fork). Add a --submodule option to init that automatically syncs the submodules in the manifest repo whenever the manifest repo changes. Change-Id: I45d34f04517774c1462d7f233f482d1d81a332a8 Signed-off-by: Martin Kelly <mkelly@xevo.com>
* init: Add no-tags and current branch optionsNaseer Ahmed2016-12-011-1/+7
| | | | | | This avoids fetching tags and branches for huge manifests Change-Id: I19c9724d75364440b881b297d42b906f541f73ff
* Merge "Add a check and more output to protect against invalid REPO_URLs"David Pursehouse2016-10-291-1/+8
|\
| * Add a check and more output to protect against invalid REPO_URLsSebastian Schuberth2016-10-281-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If you don't know that the url to git-repo itself can be overridden via REPO_URL, it's hard to debug cases where REPO_URL is accidentally set to another repository, e.g. inside a Jenkins CI job. What makes is even harder is that the ".repo/repo" directory gets silently removed in such cases as verifications fails, which makes it impossible to look at the cloned files to understand the problem. To better protect against such an issue, warn if the cloned git-repo repository does not contain a top-level "repo" file, and state that the ".repo/repo" directory will be removed in case of a clone failure. Change-Id: I697b4999205a5967910c0237772ccaada01e74d4
* | repo: add comment for updating maintainer keysMike Frysinger2016-09-141-0/+3
|/ | | | Change-Id: Ic1e7557f9597234033561ab9fb3104b87e30015e
* Increment the wrapper versionDavid Pursehouse2016-08-171-1/+1
| | | | | | | | | | | | | | There have been a number of changes in the repo wrapper since the last increment that was done in fee390ee: - 9711a98 init: Add --no-clone-bundle option - 631d0ec Support non-ASCII GNUPGHOME environment variable - 4088eb4 repo: Cleaned up pylint/pep8 violations - 5553628 repo: Add check of REPO_URL env variable - 745b4ad Fix gitc-init behavior - d3ddcdb Ignore clone.bundle on HTTP 501, i.e. Not Implemented Change-Id: I3f763ef0ec2df2d726dff429021b48ad474148f1
* init: Add --no-clone-bundle optionHu xiuyun2016-08-151-3/+6
| | | | | Bug: Issue 218 Change-Id: I42ba1f5fb9168875da0df6bdf4fe44c8d6498d54
* Support non-ASCII GNUPGHOME environment variableDāvis Mosāns2016-07-161-2/+8
| | | | | | | Here we don't need to encode this gpg_dir string when using Python 2.7 on Linux. Change-Id: I56724e9511d3b1aea61535e654a45c212130630d
* Merge "Ignore clone.bundle on HTTP 501, i.e. Not Implemented"David Pursehouse2016-04-051-1/+1
|\
| * Ignore clone.bundle on HTTP 501, i.e. Not ImplementedJohn Törnblom2015-08-121-1/+1
| | | | | | | | Change-Id: I03ee003d3bd5d0684a31bdf7961a55a511dfa0e2
* | repo: Cleaned up pylint/pep8 violationsMark E. Hamilton2016-02-151-42/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I noticed when running pylint (as the SUBMITTING_PATCHES file directs) that there were a number of violations reported. This makes it difficult to see violations I might have introduced. This commit corrects all pylint violations in the repo script. First I ran this to clean up the formatting: autopep8 --max-line-length=80 --indent-size 2 repo Following that the following violations remained: % pylint --rcfile=.pylintrc repo ************* Module repo W:220,21: Redefining name 'init_optparse' from outer scope (line 156) (redefined-outer-name) W:482, 2: No exception type(s) specified (bare-except) C:704, 0: Old-style class defined. (old-style-class) For line 220, the parameter to _GitcInitOptions was renamed so as not to mask the init_optparse global. For line 482, a pylint directive was added to disable the bare-execpt violation for just that line. For line 704, the _Options class was changed to subclass object. Additionally, the comments at lines 107-113 were spaced out to line up with the comment at line 112 that autopep8 moved. This script now has a pylint score of 10.0 Change-Id: I779b66eb6b061a195d3c4372b99dec1b6d2a214f
* | repo: Add check of REPO_URL env variableMark E. Hamilton2016-02-091-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | We want to be able to run repo on a system that is not connected to the Internet and cannot access https://gerrit.googlesource.com. We can put a clone of that repos there, but would prefer to use the stable version of the repo script instead of a locally modified version. This commit adds a check for the REPO_URL environment variable. If that is set and not empty its value will be set in the REPO_URL global in repo. Otherwise the standard path will be used. Change-Id: I0616f5f81ef75f3463b73623b892cb5eed6bb7ba
* | Fix gitc-init behaviorv1.12.32Dan Willemsen2015-10-071-4/+34
| | | | | | | | | | | | | | | | | | | | | | | | With gitc-init, a gitc client may be specified using '-c'. If we're not currently in that client, we need to change directories so that we don't affect the local checkout, and to ensure that repo is checked out in the new client. This also makes '-c' optional if already in a gitc client, to match the rest of the init options. Change-Id: Ib514ad9fd101698060ae89bb035499800897e9bd
* | launcher: Update repo after applying clone.bundleDan Willemsen2015-09-021-3/+2
| | | | | | | | | | | | | | | | | | | | | | If the clone.bundle is out of date, repo may be installed with an old version. It will upgrade with the next sync a day later, or when "repo selfupdate" is run. This behavior was added to normal project downloads, but was never added to the repo launcher. Change-Id: Ib04bef3a658c98fe1b6c53b3e8d0067165a5e3f7
* | gitc: Improve help visibilityv1.12.28Dan Willemsen2015-09-011-2/+15
| | | | | | | | | | | | | | This improves the visiblity of gitc-init if we can get the gitc config, and hides it otherwise. Change-Id: I82830b0b07c311e8c74397ba79eb4c361f8b6fb5
* | Fix gitc check if gitc isn't installedDan Willemsen2015-08-311-2/+3
| | | | | | | | | | | | This was doing cwd.startswith(''), which is always true. Change-Id: Icc059c09492b31e2d7651e4a595bda783c5abc47
* | GITC: Pull GITC Manifest Dir from the config.Simran Basi2015-08-311-2/+27
| | | | | | | | | | | | | | Updates the repo launcher and gitc_utils to pull the manifest directory location out of the gitc config file. Change-Id: Id08381b8a7d61962093d5cddcb3ff6afbb13004b
* | GITC: Add gitc-init subcommand to repo.Simran Basi2015-08-121-3/+24
|/ | | | | | | | | | | | Adds the new gitc-init command to set up a GITC client. Gitc-init sets up the client directory and calls repo init within it. Once the repo is initialized, then generates a GITC manifest file by using git ls-remote on each project and retrieving the HEAD SHA to use as the revision attribute. Gitc-init inherits from and has all the options as repo init. Change-Id: Icd7e47e90eab752a77de7c80ebc98cfe16bf6de3
* Revert "Change the min git version from 1.7.2 to 1.8.2"Anthony King2015-03-301-2/+2
| | | | | | This reverts commit 52b99aa91d0fbb5ea363b5febb367d602dbc56db. Change-Id: I01d93704c92f7af1ca2b36dbc9509ee1290e2d3c
* Change the min git version from 1.7.2 to 1.8.2Conley Owens2015-03-181-2/+2
| | | | | | This is needed for the --unshallow option of git fetch. Change-Id: Ifdc5cec6130315c643924328fea425f1b94cb04a
* Don't exit with error on HTTP 401 when downloading clone bundlePascal Bach2015-03-111-1/+1
| | | | | | | | If the server returns HTTP 401 (unauthorized) when attempting to download clone bundle files, ignore it and continue, rather than exiting with a fatal error. Change-Id: I2c7ee03e149c354c7e4ad6ea1ebf266534778fe1
* Change implementation of cleanup in case of clone failure during "repo init"Mani Chandel2014-09-031-1/+1
| | | | | | | | Fix includes: 1. It deletes only .repo/repo instead of the whole .repo repository. Bug: Issue 161 Change-Id: I1ab8caa7538fec5e6206d1b029f63bd3f60dedcd
* Prevent warning twice about Python 3 usageAnthony King2014-05-061-4/+4
| | | | | | | Only warn about using Python 3 when running the repo script directly. This prevents the user being warned twice. Change-Id: I2ee51ea2fa0127ea310598320e460ec9f38c6488
* Don't try to remove .repo if it doesn't existMitchel Humpherys2014-03-121-6/+2
| | | | | | | | | | | | | | | | | | Part of the cleanup path for _Init is removing the .repo directory. However, _Init can fail before creating the .repo directory, so trying to remove it raises another exception: fatal: invalid branch name 'refs/changes/53/55053/4' Traceback (most recent call last): File "/home/mitchelh/bin/repo", line 775, in <module> main(sys.argv[1:]) File "/home/mitchelh/bin/repo", line 749, in main os.rmdir(repodir) OSError: [Errno 2] No such file or directory: '.repo' Fix this by only removing .repo if it actually exists. Change-Id: Ia251d29e9c73e013eb296501d11c36263457e235
* Update the version number on the repo launcherv1.12.13Conley Owens2014-01-301-1/+1
| | | | | | | The repo launcher version needs to be updated so some users can take advantage of the more robust version number parsing. Change-Id: Ibcd8036363311528db82db2b252357ffd21eb59b
* Share git version parsing code with wrapper modulev1.12.12Conley Owens2014-01-301-3/+16
| | | | | | | 'repo' and 'git_command.py' had their own git version parsing code. This change shares that code between the modules. DRY is good. Change-Id: Ic896d2dc08353644bd4ced57e15a91284d97d54a
* Fix os.mkdir race condition.David James2013-12-261-12/+13
| | | | | | | | | This code checks whether a dir exists before creating it. In between the check and the mkdir call, it is possible that another process will have created the directory. We have seen this bug occur many times in practice during our 'repo init' tests. Change-Id: Ia47d39955739aa38fd303f4e90be7b4c50d9d4ba
* Add --archive option to init to sync using git archiveJulien Campergue2013-12-101-0/+4
| | | | | | | | | | | | | | | This significantly reduces sync time and used brandwidth as only a tar of each project's revision is checked out, but git is not accessible from projects anymore. This is relevant when git is not needed in projects but sync speed/brandwidth may be important like on CI servers when building several versions from scratch regularly for example. Archive is not supported over http/https. Change-Id: I48c3c7de2cd5a1faec33e295fcdafbc7807d0e4d Signed-off-by: Julien Campergue <julien.campergue@parrot.com>
* Allow using repo with python3Chirayu Desai2013-11-211-2/+1
| | | | | | | | | | * Switching from python2 to python3 in the same workspace isn't currently supported, due to a change in the pickle version (which isn't supported by python2) * Basic functionality does work with python3, however not everything is expected to Change-Id: I4256b5a9861562d0260b503f972c1569190182aa
* Merge "repo: use explicit Python executable to run main.py"Conley Owens2013-10-101-2/+2
|\
| * repo: use explicit Python executable to run main.pyanatoly techtonik2013-09-211-2/+2
| | | | | | | | | | | | Small step to support non-POSIX platforms. Change-Id: I3bdb9c82c2dfbacb1da328caaa1a406ab91ad675
* | Do not use print_function from __future__Conley Owens2013-09-271-63/+70
| | | | | | | | | | | | | | | | Python 2.4 and 2.5 do not have a print_function available, so we need a compatible print function for displaying an error message when the user has an older version of Python. Change-Id: I54d7297be98bb53970e873b36c6605e6dad386c3
* | Update gpg key for cco3@android.comv1.12.3.1v1.12.3Conley Owens2013-07-011-28/+28
| | | | | | | | | | | | | | cco3@android.com has a new gpg key, so this needs to be updated in the repo scripts so that he can sign updates. Change-Id: I9f058263b35bd027502d6e3b814d7aeb801a1e6e
* | Move Python version checking to a separate moduleDavid Pursehouse2013-05-231-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a new module with methods for checking the Python version. Instead of handling Python3 imports with try...except blocks, first check the python version and then import the relevant modules. This makes the code a bit cleaner and will result in less diff when/if we remove support for Python < 3 later. Use the same mechanism to handle `input` vs. `raw_input` and add suppression of pylint warnings caused by redefinition of the built-in method `input`. Change-Id: Ia403e525b88d77640a741ac50382146e7d635924 Also-by: Chirayu Desai <cdesai@cyanogenmod.org> Signed-off-by: Chirayu Desai <cdesai@cyanogenmod.org>
* | repo: add rudimentary version checkingChirayu Desai2013-04-171-0/+14
| | | | | | | | | | Change-Id: I957775c7ce0821971cc2320597e1a7a31950bcf3 Signed-off-by: Chirayu Desai <cdesai@cyanogenmod.org>
* | Special handling for manifest group "default"David Holmer2013-04-031-1/+2
|/ | | | | | | | | | | | | | | | | | | | | Change Details: * Make "default" a special manifest group that matches any project that does not have the special project group "notdefault" * Use "default" instead of "all,-notdefault" when user does not specify manifest group * Expand -g option help to include example usage of manifest groups Change Benefits: * Allow a more intuitive and expressive manifest groups specification: * "default" instead of "all,-notdefault" * "default,foo" instead of "all,-notdefault,foo" * "default,-foo" instead of "all,-notdefault,-foo" * "foo,-default" which has no equivalent * Default manifest groups behavior can be restored by the command 'repo init -g default'. This is significantly more intuitive than the current equivalent command 'repo init -g all,-notdefault'. Change-Id: I6d0673791d64a650110a917c248bcebb23b279d3
* Don't exit with error on HTTP 403 when downloading clone bundleDavid Pursehouse2013-01-311-1/+1
| | | | | | | | If the server returns HTTP 403 (forbidden) when attempting to download clone bundle files, ignore it and continue, rather than exiting with a fatal error. Change-Id: Icf78cba0332b51b0e7b622f7c7924369b551b6f6
* Sync help text in repo from init.pyDavid Pursehouse2012-11-151-2/+3
| | | | | | | | Change Ia6032865f9296b29524c2c25b72bd8e175b30489 improved the help text for the init command, but the same improvement was not made in repo. Change-Id: Idc34e479b5237137b90e8b040824776e4f7883b0
* Tidy up code formatting a bit moreDavid Pursehouse2012-11-141-3/+3
| | | | | | | | | | | | Enable the following Pylint warnings: C0322: Operator not preceded by a space C0323: Operator not followed by a space C0324: Comma not followed by a space And make the necessary fixes. Change-Id: I74d74283ad5138cbaf28d492b18614eb355ff9fe
* Fix: "Statement seems to have no effect"David Pursehouse2012-11-141-1/+1
| | | | | | | | | | | | Pylint raises an error on the call: print Change it to: print() Change-Id: I507e1b3dd928fa6c32ea7e86260fb3d7b1428e6f
* Change print statements to work in python3Sarah Owens2012-11-131-67/+59
| | | | | | This is part of a series of changes to introduce Python3 support. Change-Id: I373be5de7141aa127d7debdbce1df39148dbec32
* More code style cleanupDavid Pursehouse2012-11-141-5/+5
| | | | | | | | | Clean up a few more unnecessary usages of lambda in `repo` that were missed in the previous sweep that only considered files ending in .py. Remove a duplicate import. Change-Id: I03cf467a5630cbe4eee6649520c52e94a7db76be
* Remove magic hackDavid Pursehouse2012-11-141-9/+1
| | | | | | | | | | | | | It should be assumed that on modern development environments, python is accessible to /usr/bin/env Change the shebang as necessary and remove the magic hack. This also means losing the -E option on the call to python, so that PYTHONPATH and PYTHONHOME will be respected and local configuration problems in those vars would be noticed Change-Id: I6f0708ca7693f05a4c3621c338f03619563ba630