summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Honor http_proxy variable globallyShawn O. Pearce2011-09-112-6/+8
| | | | | | | | If the http_proxy environment variable was set, honor it during the entire repo session for any Python created HTTP connections. Change-Id: Ib4ae833cb2cdd47ab0126949f6b399d2c142887d Signed-off-by: Shawn O. Pearce <sop@google.com>
* Change default REPO_URL to code.google.comShawn O. Pearce2011-09-051-2/+2
| | | | Change-Id: If7700daf96fb8f3ee449e5774017272ef31b4b44
* Add commit-msg hook also for manifest projectVictor Boivie2011-07-201-1/+4
| | | | | | | | | | | | | | | The manifest project has - by design - not a review URL associated with it. It is actually not even a 'project' in repo's sense. This will prevent the commit-msg hook from being added, which is not necessarily wanted as the project is managed in gerrit. This commit will enable the commit-msg hook, which in turn will add the Change-Id-line to every new commit in it. This simplifies replacing patch sets (by git push ... refs/for/...). Change-Id: I42d0f6fd79e6282d9d47074a3819e68d968999a7 Signed-off-by: Victor Boivie <victor.boivie@sonyericsson.com>
* Smart tag supportVictor Boivie2011-07-201-15/+23
| | | | | | | | | This is an evolution of 'smart-sync' that adds a new option, -t, that allows you to specify a tag/label to use instead of the "latest good build" on the current manifest branch which -s does. Signed-off-by: Victor Boivie <victor.boivie@sonyericsson.com> Change-Id: I8c20fd91104a6aafa0271d4d33f6c4850aade17e
* Honor 'http_proxy' environment variableAnatol Pomozov2011-07-201-0/+6
| | | | | | | | | | | 'repo upload' makes http request using urllib2 python library. Unfortunately this library does not work (by default) in case if the user behind a proxy. This change adds proxy handler in case if 'http_proxy' environment variable is set. Change-Id: Ic4176ad733fc21bd5b59661b3eacc2f0a7c3c1ff
* Add --depth option to main repo wrapper.Doug Anderson2011-06-141-2/+5
| | | | | | | See related repo change: https://review.source.android.com/#change,22722 Change-Id: I9bdd86971c94604477b91cdf47d6fac2c0bc186e
* Add a --depth option to repo init.v1.7.5Doug Anderson2011-06-092-0/+31
| | | | Change-Id: Id30fb4a85f4f8a1847420b0b51a86060041eb5bf
* Add branch support to repo uploadMandeep Singh Baines2011-05-262-2/+11
| | | | | | | | | | | | | | | | This commit adds a --br=<branch> option to repo upload. repo currently examines every non-published branch. This is problematic for my workflow. I have many branches in my kernel tree. Many of these branches are based off of upstream remotes (I have many remotes) and will never be uploaded (they'll get sent upstream as a patch). Having repo scan these branches adds to my upload processing time and clutters the branch selection buffer. I've also seen repo get confused when one of my branches is 1000s of commits different from m/master. Change-Id: I68fa18951ea59ba373277b57ffcaf8cddd7e7a40
* Added repo cherry-pick commandv1.7.4.3Victor Boivie2011-04-071-0/+114
| | | | | | | | | | | | | | | | | | It is undesired to have the same Change-Id:-line for two separate commits, and when cherry-picking, the user must manually change it. If this is not done, bad things may happen (such as when the user is uploading the cherry-picked commit to Gerrit, it will instead see it as a new patch-set for the original change, or worse). repo cherry-pick works the same was as git cherry-pick, except that it replaces the Change-Id with a new one and adds a reference back to the commit from where it was picked. On failures (when git can not successfully apply the cherry-picked commit), instructions will be written to the user. Change-Id: I5a38b89839f91848fad43386d43cae2f6cdabf83
* Fixed repo checkout error message when git reports errors.Doug Anderson2011-04-072-10/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the current version of repo checkout, we often get the error: error: no project has branch xyzzy ...even when the actual error was something else. This fixes it to only report the 'no project has branch' when that is actually true. This fix is very similar to one made for 'repo abandon': https://review.source.android.com/#change,22207 The repo checkout error is filed as: <http://crosbug.com/6514> TEST=manual A sample creating a case where 'git checkout' will fail: $ repo start branch1 . $ repo start branch2 . $ touch bogusfile $ git add bogusfile $ git commit -m "create bogus file" [branch2 f8b6b08] create bogus file 0 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 bogusfile $ echo "More" >> bogusfile $ repo checkout branch1 . error: chromite/: cannot checkout branch1 A sample case showing that we still fail if no project has a branch: $ repo checkout xyzzy . error: no project has branch xyzzy Change-Id: I48a8e258fa7a9c1f2800dafc683787204bbfcc63
* Fixed problems w/ 2nd repo init if first repo init had bad URL.Doug Anderson2011-04-071-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the simplest fix: if we had problems syncing the manifest.git directory and we were the ones that created it, we should delete it. This doesn't try to do anything complex like try to recover from a .repo directory that got broken in some other way. This is filed as: <http://crosbug.com/13403> TEST=manual Init once with a bad URL: $ repo init -u http://foobar.example.com Getting manifest ... from http://foobar.example.com Connection closed by 172.22.121.77 error: Couldn't resolve host 'foobar.example.com' while accessing http://foobar.example.com/info/refs fatal: HTTP request failed fatal: cannot obtain manifest http://foobar.example.com Init again: identical to the first. Good: $ repo init -u http://foobar.example.com Getting manifest ... from http://foobar.example.com Connection closed by 172.22.121.77 error: Couldn't resolve host 'foobar.example.com' while accessing http://foobar.example.com/info/refs fatal: HTTP request failed fatal: cannot obtain manifest http://foobar.example.com Init with correct URL: $ repo init -u http://git.chromium.org/git/manifest -m minilayout.xml Getting manifest ... from http://git.chromium.org/git/manifest [ ... cut ... ] repo initialized in /.../repoiniterr Try a bad URL after a good one; it doesn't get saved (good): $ repo init -u http://foobar.example.com Connection closed by 172.22.121.77 error: Couldn't resolve host 'foobar.example.com' while accessing http://foobar.example.com/info/refs fatal: HTTP request failed fatal: cannot obtain manifest http://foobar.example.com Just to confirm, I can still do a good one after a bad... $ repo init -u http://git.chromium.org/git/manifest -m minilayout.xml Your Name [George Washington]: Your Email [george@washington.example.com]: Your identity is: George Washington <george@washington.example.com> is this correct [y/n]? y repo initialized in /.../repoiniterr Change-Id: I1692821a330d97b1d218b2e191a93245b33f2362
* Fixed repo abandon to give better messages.Doug Anderson2011-04-072-12/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The main fix is to give an error message if nothing was actually abandoned. See <http://crosbug.com/6041>. The secondary fix is to list projects where the abandon happened. This could be done in a separate CL or dropped altogether if requested. TEST=manual $ repo abandon dougabc; echo $? Abandon dougabc: 100% (127/127), done. Abandoned in 2 project(s): chromite src/platform/init 0 $ repo abandon dougabc; echo $? Abandon dougabc: 100% (127/127), done. error: no project has branch dougabc 1 $ repo abandon dougabc; echo $? Abandon dougabc: 100% (127/127), done. error: chromite/: cannot abandon dougabc 1 Change-Id: I79520cc3279291acadc1a24ca34a761e9de04ed4
* Add option to check status of projects in parallel.Terence Haddock2011-04-072-10/+70
| | | | Change-Id: I6ac653f88573def8bb3d96031d3570ff966251ad
* Fix parallel sync on python < 2.6.Daniel Sandler2011-04-041-2/+2
| | | | | | | | Event.isSet was renamed to is_set in 2.6, but we should use the earlier syntax to avoid breaking compatibility with older Python installations. Change-Id: I41888ed38df278191d7496c1a6eed15e881733f4
* sync: Fix syntax error on Python 2.4v1.7.4.2Shawn O. Pearce2011-03-221-22/+23
| | | | | Change-Id: I371d032d5a1ddde137721cbe2b24bfa38f20aaaa Signed-off-by: Shawn O. Pearce <sop@google.com>
* Creating rr-cachev1.7.4.1Victor Boivie2011-03-171-0/+5
| | | | | | | | | | | If git-rerere is enabled, it uses the rr-cache directory that repo currently creates a symlink from, but doesn't create the destination directory (inside the project's directory). Git will then complain during merges and rebases. This commit creates the rr-cache directory inside the project. Change-Id: If8b57a04f022fc6ed6a7007d05aa2e876e6611ee
* Make 'repo sync -jN' exit with an error code in the case of sync errors.Doug Anderson2011-03-171-14/+70
| | | | | | | | | | | | The bug that this is fixing is described here: http://code.google.com/p/chromium-os/issues/detail?id=6813 This fix allows the helper threads to signal the main thread that they saw an error. When the main thread sees the error, it will let all existing threads finish, then exit with an error. Change-Id: If3019bc6b0b3ab9304d49ed2eea53e9d57f3095a
* Add 'list' command to repo.Doug Anderson2011-03-161-0/+48
| | | | | | | This isn't a required command, but might be more discoverable for repo newbies? Change-Id: If357346f234774d42e04e024e65acdaf6dca6c62
* Support repo-level pre-upload hook and prep for future hooks.v1.7.4Doug Anderson2011-03-115-32/+384
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | All repo-level hooks are expected to live in a single project at the top level of that project. The name of the hooks project is provided in the manifest.xml. The manifest also lists which hooks are enabled to make it obvious if a file somehow failed to sync down (or got deleted). Before running any hook, we will prompt the user to make sure that it is OK. A user can deny running the hook, allow once, or allow "forever" (until hooks change). This tries to keep with the git spirit of not automatically running anything on the user's computer that got synced down. Note that individual repo commands can add always options to avoid these prompts as they see fit (see below for the 'upload' options). When hooks are run, they are loaded into the current interpreter (the one running repo) and their main() function is run. This mechanism is used (instead of using subprocess) to make it easier to expand to a richer hook interface in the future. During loading, the interpreter's sys.path is updated to contain the directory containing the hooks so that hooks can be split into multiple files. The upload command has two options that control hook behavior: - no-verify=False, verify=False (DEFAULT): If stdout is a tty, can prompt about running upload hooks if needed. If user denies running hooks, the upload is cancelled. If stdout is not a tty and we would need to prompt about upload hooks, upload is cancelled. - no-verify=False, verify=True: Always run upload hooks with no prompt. - no-verify=True, verify=False: Never run upload hooks, but upload anyway (AKA bypass hooks). - no-verify=True, verify=True: Invalid Sample bit of manifest.xml code for enabling hooks (assumes you have a project named 'hooks' where hooks are stored): <repo-hooks in-project="hooks" enabled-list="pre-upload" /> Sample main() function in pre-upload.py in hooks directory: def main(project_list, **kwargs): print ('These projects will be uploaded: %s' % ', '.join(project_list)) print ('I am being a good boy and ignoring anything in kwargs\n' 'that I don\'t understand.') print 'I fail 50% of the time. How flaky.' if random.random() <= .5: raise Exception('Pre-upload hook failed. Have a nice day.') Change-Id: I5cefa2cd5865c72589263cf8e2f152a43c122f70
* Post-nonexistent-revision crash sidesteppedSkyler Kaufman2011-03-081-2/+2
| | | | | | | | | Fix for the bug that leaves a fractional .git directory after attempting to perform an initial sync to a nonexistent revision. Moved the initialization of the working directory to after the revision ID has already been checked. Now, no project/.git directory gets created at all if the revision ID is bad. Change-Id: I0c9b2a59573410f1d11de7661591bf02e4ce326b
* Renamed 'repo_hooks' function to '_ProjectHooks'.Doug Anderson2011-02-011-7/+18
| | | | | | | | | | | | | | This renaming was done for two reasons: 1. The hooks are actually project-level hooks, not repo-level hooks. Since we are talking about adding repo-level hooks, It keeps things less confusing if we name the existing hooks to be "ProjectHooks" 2. The function is a private function in project.py and so should have capitalization to match. I also added a docstring describing this function. Change-Id: I1d30f5de08e8f9f99f78146e68c76f906782d97e
* Fixed bug identifying 'commit-msg' files.Doug Anderson2011-02-011-1/+1
| | | | | | | | | | | There was a minor typo that would cause repo to (I believe) mistakenly identify any file that contained a substring of the word 'commit-msg' as a commit message hook. For example, the file 'mit' or the file 'msg' would be treated as a commit message hook. I believe that it was intended that repo only recognize files named exactly 'commit-msg'. Change-Id: I93edbddf3da3cf0935641e6efb19b0a8ee6e2308
* Fix mirror clients with no worktreev1.7.3.1Shawn O. Pearce2011-01-101-1/+4
| | | | | | | | Commit "Make path references OS independent" (df14a70c45) broke mirror clients by trying to invoke replace() on None when there is no worktree. Change-Id: Ie0a187058358f7dcdf83119e45cc65409c980f11
* Bump repo version to 1,10v1.7.3Shawn O. Pearce2011-01-101-1/+1
| | | | Change-Id: Ifdc041e7152af31de413b9269f20000acd945b3b
* help: Don't show empty Summary or Description sectionsShawn O. Pearce2011-01-091-0/+2
| | | | | Signed-off-by: Shawn O. Pearce <sop@google.com> (cherry picked from commit 60e679209a5495393ef584efaaad287fc8b77c51)
* sync: Run `git gc --auto` after fetchShawn O. Pearce2011-01-092-0/+3
| | | | | | | | | | | | | Users may wind up with a lot of loose object content in projects they don't frequently make changes in, but that are modified by others. Since we bypass many git code paths that would have otherwise called out to `git gc --auto`, its possible for these projects to have their loose object database grow out of control. To help prevent that, we now invoke it ourselves during the network half of sync. Signed-off-by: Shawn O. Pearce <sop@google.com> (cherry picked from commit 1875ddd47c0bf38e5cc52e1e5875caabce2d8742)
* Add "repo branch" as an alias for "repo branches"Mike Lockwood2011-01-091-0/+2
| | | | | | | For those of us that are used to typing "git branch". Signed-off-by: Mike Lockwood <lockwood@android.com> (cherry picked from commit 33f0e786bb35ea11da1e3d1746c431da5f1d93eb)
* upload: Catch and cleanly report connectivity errorsShawn O. Pearce2011-01-092-6/+14
| | | | | | | | | | | Instead of giving a Python backtrace when there is a connectivity problem during repo upload, report that we cannot access the host, and why, with a halfway decent error message. Bug: REPO-45 Change-Id: I9a45b387e86e48073a2d99bd6d594c1a7d6d99d4 Signed-off-by: Shawn O. Pearce <sop@google.com> (cherry picked from commit d2dfac81ad6a060179b4b2289060af2dc7a5cdfd)
* forall: Silently skip missing projectsShawn O. Pearce2011-01-091-0/+6
| | | | | | | | | | If a project is missing locally, it might be OK to skip over it and continue running the same command in other projects. Bug: REPO-43 Change-Id: I64f97eb315f379ab2c51fc53d24ed340b3d09250 Signed-off-by: Shawn O. Pearce <sop@google.com> (cherry picked from commit d4cd69bdef28c5a9287c85c48a18ce621eba689d)
* Fix to display the usage message of the command download when the userThiago Farina2011-01-091-0/+3
| | | | | | | don't provide any arguments to 'repo download'. Signed-off-by: Thiago Farina <thiago.farina@gmail.com> (cherry picked from commit 840ed0fab7cb4c2ab296c7d7d45f13e2523bae1c)
* Use os.environ.copy() instead of dict()Shawn O. Pearce2011-01-091-1/+1
| | | | | Signed-off-by: Shawn O. Pearce <sop@google.com> (cherry picked from commit 3218c13205694434edb2375ab8a8515554eed366)
* Make path references OS independentAnthony Newnam2011-01-094-6/+12
| | | | | | | | | Change-Id: I5573995adfd52fd54bddc62d1d1ea78fb1328130 (cherry picked from commit b0f9a02394779c1c9422a9649412c9ac5fb0f12f) Conflicts: command.py
* Encode the environment variables passed to gitShawn O. Pearce2011-01-094-14/+17
| | | | | | | | Windows allows the environment to have unicode values. This will cause Python to fail to execute the command. Change-Id: I37d922c3d7ced0d5b4883f0220346ac42defc5e9 Signed-off-by: Shawn O. Pearce <sop@google.com>
* Exit with statuscode 0 for repo help initTrond Norbye2011-01-091-0/+1
| | | | | | | | | | | The complete help text is printed, so the program executed successfully. Some tools (like OpenGrok) detects the availibility of a program by running it with a known set of options and check the return code. It is an easy and portable way of checking for the existence of a program instead of searching the path (and handle extensions) ourselves. Change-Id: Ic13428c77be4a36d599ccb8c86d893308818eae3
* Fixed race condition in 'repo sync -jN' that would open multiple masters.v1.7.2Doug Anderson2010-12-212-61/+90
| | | | | | | | This fixes the SSH Control Masters to be managed in a thread-safe fashion. This is important because "repo sync -jN" uses threads to sync more than one repository at the same time. The problem didn't show up earlier because it was masked if all of the threads tried to connect to the same host that was used on the "repo init" line.
* Added feature to print a <notice> from manifest at the end of a sync.v1.7.1Doug Anderson2010-11-013-1/+71
| | | | | | | | | | | | | | | | | | | | | | | This feature is used to convey information on a when a branch has ceased development or if it is an experimental branch with a few gotchas, etc. You add it to your manifest XML by doing something like this: <manifest> <notice> NOTE TO DEVELOPERS: If you checkin code, you have to pinky-swear that it contains no bugs. Anyone who breaks their promise will have tomatoes thrown at them in the team meeting. Be sure to bring an extra set of clothes. </notice> <remote ... /> ... </manifest> Carriage returns and indentation are relevant for the text in this tag. This feature was requested by Anush Elangovan on the ChromiumOS team.
* sync: Use --force-broken to continue other projectsv1.7Andrei Warkentin2010-10-291-3/+15
| | | | | | | | | | This adds a new flag -f/--force-broken that will allow the rest of the sync process to continue instead of bailing when a particular project fails to sync. Change-Id: I23680f2ee7927410f7ed930b1d469424c9aa246e Signed-off-by: Andrei Warkentin <andreiw@motorola.com> Signed-off-by: Shawn O. Pearce <sop@google.com>
* upload: Remove --replace optionFicus Kirkpatrick2010-10-292-83/+1
| | | | | | | It hasn't been necessary for a long time, and its functionality can be accomplished with 'git push'. Change-Id: Ic00d3adbe4cee7be3955117489c69d6e90106559
* sync --quiet: be more quietShawn O. Pearce2010-10-292-14/+27
| | | | | Change-Id: I5e8363c7b32e4546d1236cfc5a32e01c3e5ea8e6 Signed-off-by: Shawn O. Pearce <sop@google.com>
* sync: Enable use of git clone --referenceShawn O. Pearce2010-10-293-9/+111
| | | | | | | | | Use git clone to initialize a new repository, and when possible allow callers to use --reference to reuse an existing checkout as the initial object storage area for the new checkout. Change-Id: Ie27f760247f311ce484c6d3e85a90d94da2febfc Signed-off-by: Shawn O. Pearce <sop@google.com>
* Only delete corrupt pickle config files if they existUlrik Sjölin2010-10-291-2/+4
| | | | | | | | | os.remove() raises OSError if the file being removed doesn't exist. Check before calling to ensure we don't raise a useless exception on an already deleted file. Change-Id: I44c1c7dd97a47fcab8afb6c18fdf179158b6dab7 Signed-off-by: Shawn O. Pearce <sop@google.com>
* Don't allow git fetch to start ControlMasterDoug Anderson2010-10-291-1/+1
| | | | | | | | | | | To avoid connectivity problems, we don't want the ssh process that is started by git fetch to become a ControlMaster for the overall sync task. If it did, we would lose connectivity when git fetch was finished with the current project, causing later projects to not fetch efficiently. Change-Id: I8d0dcf9b361276ff8c8b5a6324cbd4a501e9c4dd Signed-off-by: Shawn O. Pearce <sop@google.com>
* Check for existing SSH ControlMasterDoug Anderson2010-10-291-12/+41
| | | | | | | | | Be more thorough about checking for an existing ssh master by running a test command first, and only opening up a new master if the test fails to connect. Change-Id: I56fe8e7b4dbc123675b7f259e81d359ed0cd55cf Signed-off-by: Shawn O. Pearce <sop@google.com>
* Fix for handling values of EDITOR which contain a space.Patrick Dubroy2010-08-061-1/+1
| | | | | | | The shell swallows the 0th arg, which was the filename. Simple fix is to pass in an extra arg for the shell to swallow. Change-Id: Iad6304ba9ccea6e7262ee06ef87d3dac57dbde81
* upload: Fix --replace flagv1.6.10.2Shawn O. Pearce2010-07-161-2/+2
| | | | | | | | --replace started to fail due to a Python error, I forgot to pass through the opt structure to the replace function. Change-Id: Ifcd7a0c715c3fd9070a4c58208612a626382de35 Signed-off-by: Shawn O. Pearce <sop@google.com>
* rebase: Pass through more optionsv1.6.10.1Shawn O. Pearce2010-07-151-7/+39
| | | | | | | | Passing through --whitespace=fix to rebase can be useful to clean up a branch prior to uploading it for review. Change-Id: Id85f1912e5e11ff9602e3b342c2fd7441abe67d7 Signed-off-by: Shawn O. Pearce <sop@google.com>
* upload: Allow review.HOST.username to override emailv1.6.10Shawn O. Pearce2010-07-152-1/+9
| | | | | | | | | | Some users might need to use a different login name than the local part of their email address for their Gerrit Code Review user account. Allow it to be overridden with the review.HOST.username configuration variable. Change-Id: I714469142ac7feadf09fee9c26680c0e09076b75 Signed-off-by: Shawn O. Pearce <sop@google.com>
* upload -t: Automatically include local branch nameShawn O. Pearce2010-07-152-13/+25
| | | | | | | | | | | If the -t flag is given to upload, the local branch name is automatically sent to Gerrit Code Review as the topic branch name for the change(s). This requires the server to be Gerrit Code Review v2.1.3-53-gd50c94e or later, which isn't widely deployed right now, so the default is opt-out. Change-Id: I034fcacb405b7cb909147152db427fe69dd7bcbf Signed-off-by: Shawn O. Pearce <sop@google.com>
* Warn users before uploading if there are local changesAnthony Newnam2010-07-152-0/+36
| | | | | Change-Id: I231d7b6a3211e9f5ec71a542a0109b0c195d5e40 Signed-off-by: Shawn O. Pearce <sop@google.com>
* sync: Try fetching a tag as a last resort before giving upJulius Gustavsson2010-07-151-3/+18
| | | | | | | | | | | | | | If a tagged commit is not reachable by the fetch refspec configured for the git (usually refs/heads/*) it will not be downloaded by 'git fetch'. The tag can however be downloaded with 'git fetch --tags' or 'git fetch tag <tag>'. This patch fixes the situation when a tag is not found after a 'git fetch'. Repo will issue 'git fetch tag <tag>' before giving up completely. Change-Id: I87796a5e1d51fcf398f346a274b7a069df37599a Signed-off-by: Shawn O. Pearce <sop@google.com>