summaryrefslogtreecommitdiffstats
path: root/subcmds
Commit message (Collapse)AuthorAgeFilesLines
* Merge "When syncing a project with a shared object store, disable automatic ↵David Pursehouse2016-09-141-4/+7
|\ | | | | | | pruning."
| * When syncing a project with a shared object store, disable automatic pruning.Gabe Black2016-09-141-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The shared object stores confuse git and make it throw away objects which are still in use. We'll avoid that problem by disabling automatic pruning on those projects, but there's nothing preventing a user from changing the config back or pruning a repository manually. BUG=chromium:375945 TEST=Ran repo sync on fresh ChromeOS checkout, starting with a branch of repo with this change. Verified that the kernel projects and no others were identified as having shared object stores, and that repo successfully disabled automatic pruning in their configs. Re-enabled pruning and ran repo sync just on one of the kernel directories. Verified that pruning was re-disabled as a result. Change-Id: I728ed5b06f0087aeb5a23ba8f5410a7cd10af5b0
* | Merge "upload: short circuit when nothing is pending"David Pursehouse2016-09-141-4/+6
|\ \
| * | upload: short circuit when nothing is pendingMike Frysinger2016-09-141-4/+6
| |/ | | | | | | | | | | | | When nothing is pending, most of this code is already short-circuited. Hoist the single check up to make this more obvious/slightly faster. Change-Id: Iec3a7e08eacd23a7c5f964900d5776bf5252c804
* / Consider local project to be default for 'repo start'Vadim Bendebury2016-09-141-2/+1
|/ | | | | | | | | | | | | | | | | | The requirement to explicitly specify the local project when starting a new repo branch is somewhat counter intuitive. This patch uses the current directory's git tree as the default project. Tested by running 'repo start <name>' observed that the result is the same as if running 'repo start <name> .' Change-Id: If106caa801b4cd5ba70dbe8354a227d59f100aa3
* Merge "init: Add --no-clone-bundle option"David Pursehouse2016-08-171-1/+10
|\
| * init: Add --no-clone-bundle optionHu xiuyun2016-08-151-1/+10
| | | | | | | | | | Bug: Issue 218 Change-Id: I42ba1f5fb9168875da0df6bdf4fe44c8d6498d54
* | Merge "init: Respect --quiet option when synching manifest repository"David Pursehouse2016-08-171-1/+1
|\|
| * init: Respect --quiet option when synching manifest repositoryDavid Pursehouse2016-08-151-1/+1
| | | | | | | | Change-Id: Ib58b7dd971670e0888e6428333050700e776b0de
* | RepoHook: allow users to approve hooks via manifestsMike Frysinger2016-08-161-1/+3
|/ | | | | | | | | | | | | | | | | | The constant prompting when registered hooks change can be tedious and has a large multiplication factor when the project is large (e.g. the AOSP). It gets worse as people want to write more checks, hooks, docs, and tests (or fix bugs), but every CL that goes in will trigger a new prompt to approve. Let's tweak our trust model when it comes to hooks. Since people start off by calling `repo init` with a URL to a manifest, and that manifest defines all the hooks, anchor trust in that. This requires that we get the manifest over a trusted link (e.g. https or ssh) so that it can't be MITM-ed. If the user chooses to use an untrusted link (e.g. git or http), then we'll fallback to the existing hash based approval. Bug: Issue 226 Change-Id: I77be9e4397383f264fcdaefb582e345ea4069a13
* diffmanifests: support custom git pretty format stringsSebastian Schuberth2016-04-211-6/+15
| | | | Change-Id: I29f4f1351c421f393328514d145df1a96aed9ee2
* sync: Update help text for --smart-sync to be more specificDavid Pursehouse2016-04-131-1/+1
| | | | | | | The --smart-sync option should return the manifest for *the latest* known good build. Change-Id: I2f3216b5b9e1af2ea5f9c3bf1c025813a3b77581
* Add --inverse-regex option to forall subcommandTakeshi Kanemoto2016-04-051-3/+8
| | | | | | | | | | Make it possible to exclude projects using regex/wildcard. The syntax is similar to that of the -r option, e.g.: repo forall -i ^platform/ ^device/ -c 'echo $REPO_PROJECT' Change-Id: Id250de5665152228c044c79337d3ac15b5696484
* Better error display on forallAlexandre Garnier2016-02-181-2/+4
| | | | | | | It was only displaying 'Project list error: GitError()' without any useful info about the project nor the error Change-Id: Iad66cbaa03cad1053b5ae9ecc90d7772aa42ac13
* Merge "GITC: Fix 'repo start <branch> <repo>/<subdir>'"Dan Willemsen2016-02-041-5/+12
|\
| * GITC: Fix 'repo start <branch> <repo>/<subdir>'Dan Willemsen2016-02-041-5/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As soon as we wrote the gitc manifest, the folder for that repo became empty, causing the next GetProjects lookup to fail. Reorder the GetProjects calls so that they all happen while we still have the repository contents available. If you were already in a subdir, for cases like 'repo start <branch> .', this would still fail, since the working directory would disappear out from under you. That's fine most of the time, since we shouldn't be doing operations based on the local directory, but git has a realpath function that tries to restore CWD by chdir'ing back to it. So if the working directory no longer exists, chdir to the topdir before continuing. Change-Id: Ibdf6cd37ff6e5a5f8338347c3919175491f7166f
* | Add option to rebase onto project's manifest versionXiaohui Chen2016-01-281-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | Some teams have a continuous build server that would mark certain manifest green and safe to sync to. Then team members could repo sync to that particular manifest file and make sure they always sync to a green build. But if she/he has some local changes and wants to rebase, currently it would be a manual process to find the correct version to rebase onto. This patch helps with that use case by automating the process to rebase onto the currently synced manifest version. Change-Id: I847c9eb6addf7f84fd3f5594fbf8c0bcc103f9a5
* | Sync: Fix error exit code when both -n and -f are usedHu Xiuyun2015-11-261-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | When repo sync is used with -f (--force-error) and a project fails to sync, the sync will continue but then exit with an error status. However if -n (--network-only) is also used, the exit code is 0, even when a project failed. Modify the logic to make sure the sync exits with the correct status. Bug: Issue 214 Change-Id: I0b5d97a34642c5aa3743750ef14a42c9d5743c1d
* | Sync: Add option to prune refs during syncDavid Pursehouse2015-10-271-1/+7
| | | | | | | | | | | | | | | | By passing --prune to the sync command, the --prune option is given to the `git fetch`, causing refs that no longer exist on the remote to be removed. Change-Id: I3cedacce14276d96ac2d5aabf2d07fd05e92bc02
* | A couple of fixes to the init command's -p option.Pascal Muetschard2015-10-221-2/+2
|/ | | | | | | | | Adds windows as one of the allowed platforms flags. Fixes -p foo to append 'platform-foo', instead of each letter (list.extend expects a list and thus appends each char in the string, rather than the string itself). Change-Id: I73a92127ac29a32fc31b335cc54a246302904140
* Fix gitc-init behaviorv1.12.32Dan Willemsen2015-10-071-10/+8
| | | | | | | | | | | | 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
* Sync: Add HTTP Cookie File header on temporary cookie fileDavid Pursehouse2015-10-021-0/+1
| | | | | | | | | | | | | | | | | | | | The .gitcookies file generated by googlesource.com does not have the header: # (Netscape) HTTP Cookie File which causes python's MozillaCookieJar.load to fail with the error: "does not look like a Netscape format cookies file" Prepend the expected header onto the generated cookie file. We don't bother to check if the header already exists on the file; repeating it does not cause any problem. Bug: Issue 207 Change-Id: I7d39720a1d36a6aae00f70691156514ebc04e579
* Sync: Don't fail when git cookies can't be loadedDavid Pursehouse2015-10-021-1/+4
| | | | | | | | If the git cookies file fails to load, use a default cookie jar instead. Bug: Issue 207 Change-Id: I7cb326c204f2784ab4dbd13801b3186667af5b78
* GITC: Add repo gitc-delete command.Simran Basi2015-10-011-0/+55
| | | | | | | | repo gitc-delete deletes a GITC client and all the locally saved sources. Useful for removing unnecessary clients and recovering disk space. Change-Id: Idf23addcea52b8713d268c34a7b37da0c5e5cd26
* Add GitcClientCommand class for GITC-specific commandsDan Willemsen2015-09-292-4/+8
| | | | | | | These won't show up as common commands in the help text unless in a GITC client, and will refuse to execute. Change-Id: Iffe82adcc9d6ddde9cb4b204f83ff018042bdab0
* fixed typo in gitc_init.py help outputAlexander Bird2015-09-111-1/+1
| | | | Change-Id: I86459bf63297487457d6c4c995dfd1e63133ec53
* GITC: Always update the gitc manifest from the repo manifestv1.12.31Dan Willemsen2015-09-093-22/+32
| | | | | | | | | | | | | | This way any changes made to the main manifest are reflected in the gitc manifest. It's also necessary to use both manifests to sync since the information required to update the gitc manifest is actually in the repo manifest. This also fixes a few issues that came up when testing. notdefault groups weren't being saved to the gitc manifest in a method that matched 'sync'. The merge branch wasn't always being set to the correct value either. Change-Id: I435235cb5622a048ffad0059affd32ecf71f1f5b
* Revert "GITC: Always update the gitc manifest from the repo manifest"Dan Willemsen2015-09-093-23/+21
| | | | | | This reverts commit 250303b437855c2b50d052a05a08ed517423af8b. Change-Id: I1fd8af20f802553151aacb953c913f3305ca6057
* GITC: Always update the gitc manifest from the repo manifestDan Willemsen2015-09-093-21/+23
| | | | | | | | | | | | | | This way any changes made to the main manifest are reflected in the gitc manifest. It's also necessary to use both manifests to sync since the information required to update the gitc manifest is actually in the repo manifest. This also fixes a few issues that came up when testing. notdefault groups weren't being saved to the gitc manifest in a method that matched 'sync'. The merge branch wasn't always being set to the correct value either. Change-Id: I5dbc850dd73a9fbd10ab2470ae4c40e46ff894de
* GITC: Fix repo sync.v1.12.29Simran Basi2015-09-031-1/+1
| | | | | | | Fixing http://b/23785024 by calling os.getcwd() because variable cwd no longer exists. Change-Id: I21ff7d059e072f9f60726db76b67587a92c878ad
* gitc: Improve help visibilityv1.12.28Dan Willemsen2015-09-012-3/+13
| | | | | | | This improves the visiblity of gitc-init if we can get the gitc config, and hides it otherwise. Change-Id: I82830b0b07c311e8c74397ba79eb4c361f8b6fb5
* GITC: Pull GITC Manifest Dir from the config.Simran Basi2015-08-312-16/+3
| | | | | | | Updates the repo launcher and gitc_utils to pull the manifest directory location out of the gitc config file. Change-Id: Id08381b8a7d61962093d5cddcb3ff6afbb13004b
* GITC: Expand relative remote URLs.Simran Basi2015-08-281-2/+4
| | | | | | | | The GITC filesystem does not understand relative URLs for remotes, so now if a remote uses a relative URL, it will be be expanded to be relative to the manifest URL. Change-Id: Ie1210758560aeb1934da3f71496aaf19c2728214
* GITC: Add repo start support.Simran Basi2015-08-282-19/+67
| | | | | | | | | | | | | | | | | | | | | Add repo start support for GITC checkouts. If the user is in the GITC FS view, they can now run repo start to check out the sources and create a new working branch. When "repo start" is called on a GITC project, the revision tag is set to an empty string and saved in a new tag: old-revision. This tells the GITC filesystem to display the local copy of the sources when being viewed. The local copy is created by pulling the project sources and the new branch is created based off the original project revision. Updated main.py to setup each command's gitc_manifest when appropriate. Updated repo sync's logic to sync opened projects and updating the GITC manifest file for the rest. Change-Id: I7e4809d1c4fc43c69b26f2f1bebe45aab0cae628
* Smartsync: Don't fail if there isn't a cookiefilev1.12.27Dan Willemsen2015-08-201-13/+16
| | | | Change-Id: I434a259f43ca9808e88051ac8ba865c519a24702
* Sync: Refactor netrc parsingDavid Pursehouse2015-08-201-10/+9
| | | | | | | | | | | | | Don't emit a message when the netrc file doesn't exist or couldn't be opened. Instead of trying to unpack the result of info.authenticators() and catching the resulting TypeError when it's None, first store it to a local and only unpack it if it has a value. Also remove an unused import. Change-Id: I5c404d91e48c261c1ab850c3e5f040c4f4c235cb
* gitc_init: Remove unused importDavid Pursehouse2015-08-201-2/+1
| | | | | | Also add missing newline at the end of the file. Change-Id: I206e6c4b033d223eb0ff5824ecbf6fd98c39c918
* Merge "Support smart-sync through persistent-http[s]"Dan Willemsen2015-08-191-1/+104
|\
| * Support smart-sync through persistent-http[s]Dan Willemsen2015-08-191-1/+104
| | | | | | | | | | | | | | Use the same cookies and proxy that git traffic goes through for persistent-http[s] to support authentication for smart-sync. Change-Id: I20f4a281c259053a5a4fdbc48b1bca48e781c692
* | GITC: Add repo sync support.Simran Basi2015-08-182-53/+39
|/ | | | | | | | | | | | | | Add repo sync support for GITC checkouts. If the user is in the GITC client directory they can still pull the sources as normal if they pass in the --force-gitc argument. Otherwise the user should call repo sync in the GITC view to update the user's remote view. (This works because .repo in the GITC view will link to .repo in the client config directory.) Part of the support for this change is the refactoring of GITC related code into gitc_utils.py. Change-Id: I2636aaa50b450b6f091309db8dd0e8f4dbdad579
* Merge "GITC: Add gitc-init subcommand to repo."Dan Willemsen2015-08-121-0/+123
|\
| * GITC: Add gitc-init subcommand to repo.Simran Basi2015-08-121-0/+123
| | | | | | | | | | | | | | | | | | | | | | | | 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
* | Merge "Support filtering by group on forall and list subcmd"David Pursehouse2015-08-052-2/+8
|\ \
| * | Support filtering by group on forall and list subcmdGraham Christensen2015-07-302-2/+8
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Enable operating against groups of repositories. As it stands, it isn't compatible with `-r/--regex`. `repo forall -g groupname -c pwd` will run `pwd` for all projects in groupname. `repo forall -g thisgroup,-butnotthisone -c pwd` will run `pwd` for all projects in `thisgroup` but not `butnotthisone`. `repo list -g groupname -n` will list all the names of repos in `groupname`. Change-Id: Ia75c50ce52541d1c8cea2874b20a4db2e0e54960
* | Merge "Emit project info in case of sync exception."Conley Owens2015-07-311-1/+3
|\ \ | |/ |/|
| * Emit project info in case of sync exception.Dan Sandler2015-07-311-1/+3
| | | | | | | | | | | | | | | | Previously repo would only print the failing project path if Sync_NetworkHalf returned false/empty, but if it threw an exception the print() was never called. Change-Id: I58c41de43930df5e34b21561c205e062a72e290f
* | Add option to correct gitdir when syncingv1.12.25Kevin Degi2015-07-291-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | In some cases, a user may wish to continue with a sync even though it would require overwriting an existing git directory. This behavior is not safe as a default because it could result in the loss of some user data, but as an optional flag it allows the user more flexibility. To support this, add a --force-sync flag to the sync command that will attempt to overwrite the existing git dir if it is specified and the existing git dir points to the wrong obj dir. Change-Id: Ieddda8ad54e264a1eb4a9d54881dd6ebc8a03833
* | Merge "Prevent repo info from crashing when default element doesn't exist."David Pursehouse2015-07-291-1/+2
|\ \
| * | Prevent repo info from crashing when default element doesn't exist.Cassidy Burden2015-07-271-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | repo info will crash when using a manifest with no default element despite default being an optional element. Output nothing for "Manifest Branch" if no default element exists (or if no default revision exists). Change-Id: I7ebffa2408863837ba980f0ab6e593134400aea9
* | | forall: use smart sync override manifest if it existsDavid Pursehouse2015-07-061-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a workspace is synced with the -s or -t option, the included projects may be different to those in the original manifest. However, when using the forall command, the list of the projects from the original manifest is used. If the smart sync manifest file exists, use it to override the original manifest. Change-Id: Iaefcbe148d2158ac046f158d98bbd8b5a5378ce7