summaryrefslogtreecommitdiffstats
path: root/subcmds
Commit message (Collapse)AuthorAgeFilesLines
...
* | init: add missing submodule argMartin Kelly2017-07-101-1/+1
| | | | | | | | | | | | | | | | | | The submodule argument to Sync_LocalHalf was missing in MetaBranchSwitch, causing submodules not to get synced when the -b/--manifest-branch argument to init is used. Change-Id: Ie86d271abac2020725770be36ead83be3326e64b Signed-off-by: Martin Kelly <mkelly@xevo.com>
* | Tell the user if it will upload a draftNicolas Cornu2017-07-101-1/+2
| | | | | | | | Change-Id: Ie004ec9d61603f3f618c47597947b82c59f2839c
* | Merge "Add a newline after "Fetching projects" progress output"David Pursehouse2017-06-281-1/+2
|\ \
| * | Add a newline after "Fetching projects" progress outputTim Schumacher2017-06-131-1/+2
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Output before change: Fetching project platform/packages/providers/UserDictionaryProvider Fetching projects: 66% (773/1171) Fetching project platform/external/regex-re2 Fetching project device/generic/mini-emulator-x86_64 Output after change: Fetching project platform/packages/providers/UserDictionaryProvider Fetching projects: 66% (773/1171) Fetching project platform/external/regex-re2 Fetching project device/generic/mini-emulator-x86_64 Change-Id: I4da84da58316c69294e4da2792f83885dc942701
* / sync: Continue job if some fetchs failed but force-broken is setNicolas Cornu2017-06-161-1/+1
|/ | | | | | | With --force-broken it continue to fetch other projects but nothing is added in directory because it abort some lines later. Change-Id: I32c4a4619b3028893dc4f98e8d4e5bc5c09adb27
* Merge "init: allow relative path on --reference argument"David Pursehouse2017-05-291-1/+1
|\
| * init: allow relative path on --reference argumentYOUNG HO CHA2017-05-281-1/+1
| | | | | | | | | | Change-Id: I41d6be6bc035fdddb5a27c072994439986d58d58 Signed-off-by: YOUNG HO CHA <ganadist@gmail.com>
* | sync: Add support to dump a JSON event log of all sync events.David Riley2017-05-291-7/+24
|/ | | | Change-Id: Id4852968ac1b2bf0093007cf2e5ca951ddab8b3b
* Merge "init: add --submodules to sync manifest submodules"David Pursehouse2017-05-272-4/+11
|\
| * init: add --submodules to sync manifest submodulesMartin Kelly2017-05-232-4/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | gitc_delete: Remove unused importsDavid Pursehouse2017-05-261-2/+0
| | | | | | | | Change-Id: I672189ba99e18dca3956e2396c921d1ef0ca2ddd
* | abandon: fix usage of undefined variableDavid Pursehouse2017-05-261-1/+1
|/ | | | | | | | | | As reported by pyflakes: subcmds/abandon.py:84: undefined name 'p' The name of the variable should be 'proj'. Change-Id: Ic09eb92e8db6b510e99efce010bd0bb094d7cbfe
* sync.py: report the remote URL on fatal git remote errorsMarc Herbert2017-04-041-1/+3
| | | | | | | | | | | | | | | | | repo can be configured to download from any number of remote git repos. However when one fails repo doesn't report which one. Example: Fatal: remote error: Daily ls-remote rate limit exceeded for IP xx.xx.xx.xx TEST=repo init -q -u https://chromium.googlesource.com/chromiumos/manifest.git # Apply patch in ./.repo/repo/ # Simulate a git remote error: sed -i -e 's#chromiumos/docs#chromiumos/XXdocs#' .repo/manifests/full.xml repo sync --quiet --force-sync docs # error message now shows the remote URL Optional test tip: reduce the time.sleep(random(...)) in ./.repo/repo/project.py Change-Id: I4509383b6a43a8e66064778e8ed612d8a735c8b6
* init: Add no-tags and current branch optionsNaseer Ahmed2016-12-011-1/+9
| | | | | | This avoids fetching tags and branches for huge manifests Change-Id: I19c9724d75364440b881b297d42b906f541f73ff
* Merge "implement optional '--all' in the abandon command"David Pursehouse2016-10-281-21/+49
|\
| * implement optional '--all' in the abandon commandKyunam.jo2016-10-171-21/+49
| | | | | | | | | | | | | | | | | | | | when you want to delete all local branches, you should be find all branches' name, and type them behind 'repo abandon' command. Usage: repo abandon --all [<project>...] Change-Id: I4d391f37fb9d89b8095488c585468eafc1a35f31
* | status: add -q/--quiet optionAndrew Wheeler2016-10-171-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The --quiet option reduces the output to just a list of projects with modified workspaces (and orphans if -o is specified) A common use case is when performing a full-workspace merge. The integrator will kick-off a merge via: repo forall -c git merge <some tag> And then produce a short list of conflicted projects via: repo status -q The integrator can then iteratively fix and clean up all conficted components. The merge is complete when: repo status -q returns no output. Change-Id: Ibbba8713eac35befd8287c95948874e23fd5c7e2
* | Merge "sync: Fix semaphore release bug that causes thread 'leaks'"David Pursehouse2016-10-171-10/+12
|\ \ | |/ |/|
| * sync: Fix semaphore release bug that causes thread 'leaks'Andrew Wheeler2016-10-111-10/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When repo syncs a manifest that utilizes multiple branches in the same project, then the sync will use an extra thread for each "duplicate". For example, if the manifest includes the project "foo" and "bar" twice, then "repo sync -jN" will fetch with N+2 threads. This is caused by _FetchHelper() releasing the thread semaphore object each time it's called, even though _FetchProjectList() may call this function multiple times within the scope of a single thread. Fix by moving the thread semaphore release to _FetchProjectList(), which is only called once per thread instance. Change-Id: I1da78b145e09524d40457db5ca5c37d315432bd8
* | Removed duplication code in abandon.pyKyunam.jo2016-10-121-1/+0
|/ | | | | | | code about getting argument is duplicated. so this line is removed Change-Id: Id321b999c7dacdb403cd986cbf35f8db62efc157
* Support broken symlinks when cleaning obsolete pathsv1.12.37Dan Willemsen2016-09-271-1/+7
| | | | | | | | | | | When there's a symlink to a directory, os.walk still lists the symlink in dirs, even if it isn't configured to follow symlinks. This will fail the listdirs check if the symlink is broken (either before or during the cleanup). So instead, check for directory symlinks and remove them using os.remove. Bug: Issue 231 Change-Id: I0ec45a26be566613a4a39bf694a3d9c6328481c2
* On project cleanup, don't remove nested projectsDan Willemsen2016-09-201-14/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | When there are nested projects in a manifest, like on AOSP right now: <project path="build" name="platform/build" /> <project path="build/blueprint" name="platform/build/blueprint" /> <project path="build/kati" name="platform/build/kati" /> <project path="build/soong" name="platform/build/soong" /> And the top "build" project is removed (or renamed to remove the nesting), repo just wipes away everything under build/ and re-creates the projects that are still there. But it only checks to see if the build/ project is dirty, so if there are dirty files in a nested project, they'll just be blown away, and a fresh worktree checked out. Instead, behave similarly to how `git clean -dxf` behaves and preserve any subdirectories that have git repositories in them. This isn't as strict as git -- it does not check to see if the '.git' entry is a readable gitdir, just whether an entry named '.git' exists. If it encounters any errors removing files, we'll print them all out to stderr and tell the user that we were unable to clean up the obsolete project, that they should clean it up manually, then sync again. Change-Id: I2f6a7dd205a8e0b7590ca5369e9b0ba21d5a6f77
* 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