summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* rebase: Automatically rebase branch on upstreaDaniel Sandler2010-07-151-0/+75
| | | | | | | | | | | | | Usage: repo rebase [[-i] <project>...] Rebases the current topic branch of the specified (or all) projects against the appropriate upstream. Note: Interactive rebase is currently only supported when exactly one project is specified on the command line. Change-Id: I7376e35f27a6585149def82938c1ca99f36db2c4 Signed-off-by: Shawn O. Pearce <sop@google.com>
* upload: Automatically --cc folks in review.URL.autocopyBen Komalo2010-07-151-1/+27
| | | | | | | | | | The upload command will read review.URL.autocopy from the project's configuration and append the list of e-mails specified to the --cc argument of the upload command if a non-empty --re argument was provided. Change-Id: I2424517d17dd3444b20f0e6a003be6e70b8904f6 Signed-off-by: Shawn O. Pearce <sop@google.com>
* Fix format string bugs in grepv1.6.9.8Sebastian Schmidt2010-06-171-4/+4
| | | | | | | | This fixes some format string bugs in grep which cause repo to with "TypeError: not enough arguments for format string" when grepping and the output contains a valid Python format string. Change-Id: Ice8968ea106148d409490e4f71a2833b0cc80816
* Do not invoke ssh with -p argument when no port has been specified.Josh Guilfoyle2010-06-081-5/+12
| | | | | | | | | This change allows local SSH configuration to choose the port number to use when not explicitly set in the manifest. (cherry picked from commit 4c0f67046543c7c6ab24175e143001f14b76ea01) Change-Id: Ibea99cfe46b6a2cc27f754cc3944a2fe10f6fda4
* Allow files to be copied into new foldersMatthew Buckett2010-05-271-0/+4
| | | | Change-Id: I7f169e32be5a4328bb87ce7c2ff4b6529e925126
* Do not emit progress if stderr is not a ttyShawn O. Pearce2010-05-271-2/+5
| | | | | | | | Avoids logging progress data into cron logs, etc. Suggested-by: Michael Richardson <mcr@sandelman.ottawa.on.ca> Change-Id: I4eefa2c282f0ca0a95a0185612b52e2146669e4c Signed-off-by: Shawn O. Pearce <sop@google.com>
* sync: support --jobs to fetch projects simultaneouslyRoy Lee2010-05-271-7/+46
| | | | | | | | | | | | | | This patch does two things for being compatibile with those Python which are built without threading support: 1. As the Python document and Shawn suggested, import dummy_threading when the threading is not available. 2. Reserve the single threaded code and make it default. In cases the --jobs does not work properly with dummy_threading, we still have a safe fallback. Change-Id: I40909ef8e9b5c22f315c0a1da9be38eed8b0a2dc
* Aliasing sync -s to 'smartsync'v1.6.9.7Nico Sallembien2010-05-172-4/+38
| | | | | | | This alias will let people use this command without having to remember the option. Change-Id: I3256d9e8e884c5be9e77f70e9cfb73e0f0c544c6
* sync: kill git fetch process before SSH control master processv1.6.9.6Shawn O. Pearce2010-05-112-2/+34
| | | | | | | | | | | | | | | | If the SSH control master process is killed while an active git fetch is using its network socket, the underlying SSH client may not realize the connection was broken. This can lead to both the client and the server waiting indefinitely for network messages which will never be sent. Work around the problem by keeping track of any processes that use the tunnels we establish. If we are about to kill any of the SSH control masters that we started, ensure the clients using them are successfully killed first. Change-Id: Ida6c124dcb0c6a26bf7dd69cba2fbdc2ecd5b2fc Signed-off-by: Shawn O. Pearce <sop@google.com>
* upload: Move confirmation threshold from 3 to 5 commitsv1.6.9.5Dan Morrill2010-05-051-1/+1
| | | | Change-Id: I7275d195cf04f02694206b9f838540b0228ff5e1
* upload: Confirm unusually large number of uploaded commitDan Morrill2010-05-041-0/+29
| | | | | | | | | Add a sentinel check to require a second explicit confirmation if the user is attempting to upload (or upload --replace) an unusually large number of commits. This may help the user to catch an accidentally incorrect rebase they had done previously. Change-Id: I12c4d102f90a631d6ad193486a70ffd520ef6ae0
* branches: Enable output of multiple projectsPär Åsfält2010-05-041-5/+7
| | | | | | | Fixes a bug introduced by 498a0e8a79ab76eeb6adc40f12b04d59820716f9 ("Make 'repo branches -a' the default behavior"). Change-Id: Ib739f82f4647890c46d7c9fb2f2e63a16a0481de
* Rename _ssh_sock() to fix code style issue.Nico Sallembien2010-04-272-5/+5
| | | | | Since _ssh_sock is imported out of the git_command module, the leading underscore should be removed from the function name.
* Override manifest file only after it is fully written to disk.v1.6.9.4Nico Sallembien2010-04-261-1/+1
| | | | | | We called "Override()" before closing the file passed in argument. Change-Id: I15adb99deb14297ef72fcb1b0945eb246f172fb0
* Strip refs/heads in the branch sent to the manifest server.Nico Sallembien2010-04-261-0/+3
| | | | | | | The manifest server doesn't want to have refs/heads passed to it, so we need to strip that when the branch contains it. Change-Id: I044f8a9629220e886fd5e02e3c1ac4b4bb6020ba
* sync: Safely skip already deleted projectsv1.6.9.3Anthony2010-04-141-25/+29
| | | | | | | Do not error if a project is missing on the filesystem, is deleted from manifest.xml, but still exists in project.list. Change-Id: I1d13e435473c83091e27e4df571504ef493282dd
* Add a 'smart sync' option to repo syncv1.6.9.2Nico Sallembien2010-04-133-3/+106
| | | | | | | | | | | | | This option allows the user to specify a manifest server to use when syncing. This manifest server will provide a manifest pegging each project to a known green build. This allows developers to work on a known good tree that is known to build and pass tests, preventing failed builds to hamper productivity. The manifest used is not "sticky" so as to allow subsequent 'repo sync' calls to sync to the tip of the tree. Change-Id: Id0a24ece20f5a88034ad364b416a1dd2e394226d
* Allow 'y' as a valid response when confirming identityv1.6.9.1Nico Sallembien2010-04-011-2/+3
| | | | | I prefer having to type only one character rather than all three, and it seems like other confirmation prompts use the same style.
* Automatically install Gerrit Code Review's commit-msg hookv1.6.9Shawn O. Pearce2010-03-062-4/+119
| | | | | | | | | | | | | Most users of repo are also using Gerrit Code Review, and will want the commit-msg hook to be automatically installed into their local projects so that Change-Ids are assigned when commits are created, not when they are first uploaded. (cherry picked from commit a949fa5d202f0a1f812d7630f3e5bf0f02ca4e98 but squashed with latest hook script from version 2.1.2) Change-Id: Ie68b2d60ac85d8c2285d2e1e6a4536eb76695547 Signed-off-by: Shawn O. Pearce <sop@google.com>
* Fail sync when encountering "N commits behind."Daniel Sandler2010-03-041-4/+3
| | | | | | | | | | This is almost always something the user needs to address before continuing work, so promoting it to a failure (rather than simply an informational message) seems the right way to go. As a side-effect, repo will now exit with a non-zero status code in this situation, so pipelines of the form `repo sync && make` will fail if there are branches that are stalled due to uploaded but unmerged patches.
* Check that we are not overwriting a local repository when syncing.v1.6.8.11Nico Sallembien2010-01-201-1/+4
| | | | | | | | If a local git repository exists within the same folder as a new project that is added, when the user syncs the repo, the sync will overwrite the local files under the project's .git repository with its own symlinks. Make sure that we do not overwrite 'normal' files in repo and throw an error when that happens.
* Honor url.insteadOf when setting up SSH control master connectionv1.6.8.10Ulrik Sjolin2010-01-041-1/+23
| | | | | | | | | | Repo can now properly handle url.insteadOf sections in the user's ~/.gitconfig file. This means that a user can now enjoy the master-ssh functionality even if he/she uses insteadOf's in ~/.gitconfig to rewrite git:// URLs to ssh:// style URLs. Change-Id: Ic0f04a9c57206a7b89eb0f10bf188c4c483debe3 Signed-off-by: Shawn O. Pearce <sop@google.com>
* sync: Fix split call on malformed email addressesv1.6.8.9Shawn O. Pearce2009-12-301-1/+1
| | | | | | | | | | | | | If an email address in a commit object contains a space, like a few malformed ones on the Linux kernel, we still want to split only on the first space. Unfortunately my brain was too damaged by Perl and originally wrote the split asking for 2 results; in Python split's argument is how many splits to perform. Here we want only 1 split, to break apart the commit identity from the email address on the same line. Signed-off-by: Shawn O. Pearce <sop@google.com>
* Fixing project renaming bug.v1.6.8.8Nico Sallembien2009-12-101-9/+9
| | | | | | | | This bug happens when a project gets added to the manifest, and then is renamed. Users who happened to have run "repo sync" after the project was added but before the rename happened will try to read the data from the old project, as the manifest was only updated after all projects were updated successfully.
* Fix error parsing a non-existant configuration filev1.6.8.7Shawn O. Pearce2009-07-022-2/+13
| | | | | | | | If a file (e.g. ~/.gitconfig) does not exist, we get None here rather than a string. NoneType lacks rstrip() so we cannot strip it. Signed-off-by: Shawn O. Pearce <sop@google.com>
* Document how to contribute to the repo projectShawn O. Pearce2009-07-021-0/+80
| | | | Signed-off-by: Shawn O. Pearce <sop@google.com>
* Support GIT_EDITOR='vim -c "set textwidth=80"'Shawn O. Pearce2009-07-021-7/+20
| | | | | | | | | If there are shell special characters in the editor string, we must use /bin/sh to parse and execute it, rather than trying to rely on a simple split(' '). This avoids vim starting up with two empty buffers, due to a misparsed command line. Signed-off-by: Shawn O. Pearce <sop@google.com>
* Try to prevent 'repo sync' as a user namev1.6.8.6Shawn O. Pearce2009-07-021-6/+19
| | | | | | | | | | | | | | | | | | | | | | | | | When someone copies and pastes a setup line from a web page, they might actually copy 'repo sync' onto the clipboard and wind up pasting it into the "Your Name" prompt. This means they will initialize their client with the user name of "repo sync", creating some rather funny looking commits later on. For example: To setup your source tree: mkdir ~/code cd ~/code repo init -u git://.... repo sync If this entire block was just blindly copy and pasted into the terminal, the shell won't read "repo sync" but "repo init" will. By showing the user their full identity string, and asking them to confirm it before we continue, we can give the hapless user a chance to recover from this mistake, without unfairly harming those who were actually named 'repo' by their parents. Signed-off-by: Shawn O. Pearce <sop@google.com>
* git_config: handle configuration entries with no valuesDavid Aguilar2009-06-293-8/+59
| | | | | | | | | A git-config entry with no value was preventing repo from initializing. This modifies _ReadGit() to handle config entries with empty values. Signed-off-by: David Aguilar <davvid@gmail.com> Reported-by: Josh Guilfoyle <jasta00@gmail.com>
* .gitignore: add an entry for repopicklesDavid Aguilar2009-06-281-0/+1
| | | | Signed-off-by: David Aguilar <davvid@gmail.com>
* Support detached HEAD in manifest repositoryv1.6.8.5Shawn O. Pearce2009-06-251-1/+1
| | | | | | | | If the manifest repository is on a detached HEAD and we are parsing an XML formatted manifest we should simply set the branch property to None, rather than crash with an AttributeError. Signed-off-by: Shawn O. Pearce <sop@google.com>
* Document any crashes from the user's text editorv1.6.8.4Shawn O. Pearce2009-06-242-2/+14
| | | | | | | | Rather than failing with no information, display the child exit status and the command line we tried to use to edit a text file. There may be some useful information to help understand the crash. Signed-off-by: Shawn O. Pearce <sop@google.com>
* Fix invalid use of try-catchShawn O. Pearce2009-06-161-1/+1
| | | | | | Its try-except in Python. Signed-off-by: Shawn O. Pearce <sop@google.com>
* Don't crash if the ssh client is already deadShawn O. Pearce2009-06-161-2/+5
| | | | | | | | | If the SSH client terminated abnormally in the background (e.g. the server shutdown while we were doing a sync) then the pid won't exist. Instead of crashing, ignore it, the result we wanted (a non-orphaned ssh process) is already acheived. Signed-off-by: Shawn O. Pearce <sop@google.com>
* branches: Describe output format in `repo help branches`v1.6.8.3Shawn O. Pearce2009-06-121-0/+27
| | | | Signed-off-by: Shawn O. Pearce <sop@google.com>
* grep: Only use --color on git 1.6.3 and laterShawn O. Pearce2009-06-121-2/+2
| | | | | | | | | | The --color flag wasn't introduced until git 1.6.3. Prior to that version, `git grep --color` just produces a fatal error, as it is an unsupported option. Since this is just pretty output and is not critical to execution, we can simply omit the option if the version of git we are running on doesn't support it. Signed-off-by: Shawn O. Pearce <sop@google.com>
* Refactor git version detection for reuseShawn O. Pearce2009-06-122-15/+26
| | | | | | | | This way we can use it to detect feature support in the underlying git, such as new options or commands that have been added in more recent versions. Signed-off-by: Shawn O. Pearce <sop@google.com>
* Ignore EOFError when reading a truncated pickle filev1.6.8.2Shawn O. Pearce2009-06-121-0/+3
| | | | | | | | | If the pickle config file is 0 bytes in length, we may have crashed (or been aborted) while writing the file out to disk. Instead of crashing with a backtrace, just treat the file as though it wasn't present and load off a `git config` fork. Signed-off-by: Shawn O. Pearce <sop@google.com>