summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Use default rebase during sync instead of rebase -iShawn O. Pearce2009-04-161-2/+2
| | | | | | | | | | | | | | | rebase interactive (aka rebase -i) has changed in newer versions of git, and doesn't always generate the sequence of commits the same way it used to. It also doesn't handle having a previously applied commit try to be applied again. The default rebase algorithm is better suited to our needs. It uses --ignore-if-in-upstream when generating the patch series for git-am, and git-am with its 3-way fallback is able to handle a rename case just as well as the cherry-pick variant used by -m. Its also a generally faster implementation. Signed-off-by: Shawn O. Pearce <sop@google.com>
* Don't divide by zero in progress meterShawn O. Pearce2009-04-161-14/+27
| | | | | | | | | If there are no projects to fetch, the progress meter would have divided by zero during `repo sync`, and that throws a ZeroDivisionError. Instead we report the progress with an unknown amount remaining. Signed-off-by: Shawn O. Pearce <sop@google.com>
* Document 'repo status' outputShawn O. Pearce2009-04-131-0/+38
| | | | Signed-off-by: Shawn O. Pearce <sop@google.com>
* Fix formatting of 'repo help sync'Shawn O. Pearce2009-04-131-0/+1
| | | | | | The formatting for the enviroment variable section was incorrect. Signed-off-by: Shawn O. Pearce <sop@google.com>
* Cleanup checkout help to match other commandsShawn O. Pearce2009-04-131-4/+6
| | | | Signed-off-by: Shawn O. Pearce <sop@google.com>
* Add 'repo selfupdate' to upgrade only repoShawn O. Pearce2009-04-132-15/+83
| | | | | | | Users may want to upgrade only repo to the latest release, but leave their working tree state alone and avoid 'repo sync'. Signed-off-by: Shawn O. Pearce <sop@google.com>
* Add 'repo grep' to support searching all projectsv1.6.5Shawn O. Pearce2009-04-101-0/+243
| | | | | | | | | Users can now use 'repo grep' to search all projects, rather than 'repo forall -c git grep'. Its not only shorter to type, but it also filters results better by highlighting which projects matched in the client workspace. Signed-off-by: Shawn O. Pearce <sop@google.com>
* status: tell the user the working tree is cleanShawn O. Pearce2009-04-102-3/+11
| | | | | | | | | If there is nothing output at all, tell the user the working tree is completely clean. It just gives them a bit more of a warm-fuzzy feeling knowing repo and until the end. It also more closely matches with the output of git status. Signed-off-by: Shawn O. Pearce <sop@google.com>
* Add a project progress meter to 'repo sync'Shawn O. Pearce2009-04-102-1/+53
| | | | | | | | This way users can see how much is left during fetch. Its especially useful when most syncs are no-ops but there are hundreds of repositories to poll. Signed-off-by: Shawn O. Pearce <sop@google.com>
* Add 'repo sync -l' to only do local operationsShawn O. Pearce2009-04-101-25/+33
| | | | | | | | | | | | | This permits usage of 'repo sync' while offline, as we bypass the network based portions of the code and do only the local sync. An example use case might be: repo sync -n ; # while we have network ... some time later ... repo sync -l ; # while without network, come up to date Signed-off-by: Shawn O. Pearce <sop@google.com>
* Add 'repo sync -d' to detach projects from their current topicShawn O. Pearce2009-04-102-3/+17
| | | | | | | | | | The -d flag moves the project back to a detached HEAD state, matching what is listed in the manifest. This can be useful to set a client to something stable (or at least well-known), such as before a sequence of 'repo download' commands are used to get some changes for testing. Signed-off-by: Shawn O. Pearce <sop@google.com>
* Add 'repo sync -n' to only do the network transferShawn O. Pearce2009-04-101-0/+7
| | | | | | | | This makes it easier to update all repositories, without actually impacting the working directory, or learning about how to use `repo forall -c 'git fetch $REPO_REMOTE' `. Signed-off-by: Shawn O. Pearce <sop@google.com>
* Hide the internal sync --repo-upgraded flag from usersShawn O. Pearce2009-04-101-1/+2
| | | | | | | | This is only meant to be passed through while repo upgrades itself during a sync. It should never be something a user invokes on their own. Signed-off-by: Shawn O. Pearce <sop@google.com>
* Make 'repo start' restartable upon failuresShawn O. Pearce2009-04-103-10/+35
| | | | | | | | | | | | | | | | | | | | If `repo start foo` fails due to uncommitted and unmergeable changes in a single project, we have switched half of the projects over to the new target branches, but didn't on the one that failed to move. This change improves the situation by doing three things differently: - We keep going when we encounter an error, so other projects that can successfully switch still switch. - We ignore projects whose current branch is already on the requested name; they are logically already setup. - We checkout the branch if it already exists, rather than trying to recreate the branch. Bug: REPO-22 Signed-off-by: Shawn O. Pearce <sop@google.com>
* Don't capture stdout during 'repo checkout'Shawn O. Pearce2009-04-101-1/+1
| | | | | | | There isn't any great value in buffering stdout into memory coming from git checkout. So don't bother doing it. Signed-off-by: Shawn O. Pearce <sop@google.com>
* Add a repo branches subcommand to describe current branchesShawn O. Pearce2009-04-102-0/+176
| | | | | | | | We now display a summary of the available topic branches in this client, based upon a sorted union of all existing projects. Bug: REPO-21 Signed-off-by: Shawn O. Pearce <sop@google.com>
* Add checkout command.Wink Saville2009-04-102-0/+59
| | | | | | | Teach repo how to checkout a branch in all projects or a list of specific projects. Bug: REPO-21
* Don't start the pager if stdout is a pipev1.6.4Shawn O. Pearce2009-04-011-1/+1
| | | | | | | | | | | | | | | The repo script often uses a pager by default and will produce control characters (coloring) to standard output when using the pager, even if the output is redirected to another pipe or script. This is because the pager setup checked for the terminal presence on FD 0, and in case of redirection FD 0 is still attached to the terminal. Instead require that both FD 0 and FD 1 are connected to the terminal in order to start the pager. Bug: REPO-19, b.android.com/2004 Signed-off-by: Shawn O. Pearce <sop@google.com>
* Only lookup review server '/ssh_info' once per repo processShawn O. Pearce2009-03-251-19/+33
| | | | | | | | If the user has multiple projects to upload changes to, and they are all going to the same review server, we only need to query the '/ssh_info' data once. Signed-off-by: Shawn O. Pearce <sop@google.com>
* Produce a useful error if /ssh_info was HTML and not plain textShawn O. Pearce2009-03-251-0/+5
| | | | | | | | | | | | | | If /ssh_info is protected by an HTML based login page, we may get back a "200 OK" response from the server with some HTML document asking us to authenticate. This can't be parsed into a host name and port number, so we shouldn't even try. Valid host names and decimal port numbers cannot contain '<', but an unexpected HTML login page would. So we test for '<' to give us a fair indicator that the content isn't what we think it is, and bail out. Signed-off-by: Shawn O. Pearce <sop@google.com>
* Handle review URLs pointing directly at GerritShawn O. Pearce2009-03-251-3/+6
| | | | | | | | | | | | If a review URL is set to 'http://host/Gerrit' because the user thinks that is the correct way to point repo at Gerrit, we should be a bit more flexible and fix the URL by dropping the '/Gerrit' suffix and replace it with '/ssh_info'. Likewise, if a review URL points already at '/ssh_info' for a Gerrit instance, we should leave it alone. Signed-off-by: Shawn O. Pearce <sop@google.com>
* Don't bother listing branch URLs during uploadShawn O. Pearce2009-03-191-3/+0
| | | | | | | | | | | Modern Gerrit2 automatically outputs the URL for each commit to stderr as it creates the records. Dumping the URL ourselves is unnecessary additional output, and worse is just an approximate guess for the correct web URL. Gerrit might not live at the top level directory for the server, or might even prefer a different hostname for web connections than what is listed in the manifest. Signed-off-by: Shawn O. Pearce <sop@google.com>
* Fix repo re-init in a mirror to not promptShawn O. Pearce2009-03-191-2/+2
| | | | | | | | | On a mirror client we don't prompt for user.name,user.email as the data is only necessary if you will make new commits. On a re-init we were testing the command line option, not the existing IsMirror property from the manifest configuration file. Signed-off-by: Shawn O. Pearce <sop@google.com>
* Allow repo init to restart if URL was initially invalidv1.6.3Shawn O. Pearce2009-03-171-1/+1
| | | | | | | This allows the user to run "repo init -u" again after an initial attempt failed due to an invalid URL. Signed-off-by: Shawn O. Pearce <sop@google.com>
* Give a more friendly error in 'repo init' if manifest url is invalidShawn O. Pearce2009-03-171-1/+5
| | | | | | | | Instead of a stack trace ending in origin/master not existing we now tell the user the manifest url is invalid if 'git fetch' has failed out early. Signed-off-by: Shawn O. Pearce <sop@google.com>
* Set forall environment variables to empty string if NoneShawn O. Pearce2009-03-171-7/+12
| | | | | | | | If the value obtained is None we now set the variable to '' instead, in an attempt to make execve() happier about our 3rd argument, the env dictionary. Signed-off-by: Shawn O. Pearce <sop@google.com>
* Support "repo init -b foo && repo sync" to switch baselinesShawn O. Pearce2009-03-091-1/+2
| | | | | | | | We now correctly support re-initializing an existing client to point to a different branch of the same manifest repository, effectively allowing the client to switch the baseline it is operating on. Signed-off-by: Shawn O. Pearce <sop@google.com>
* Don't permit "repo init --mirror" in an existing clientShawn O. Pearce2009-03-091-2/+7
| | | | | | | | | | Simply setting repo.mirror true doesn't make a client into a mirror. The on-disk layout is completely wrong for a mirror repository, and until we fix our layout for a non-mirror client to more closely resemble the upstream we can't do anything to easily turn on or turn off the mirror status flag. Signed-off-by: Shawn O. Pearce <sop@google.com>
* Add global --trace command line optionShawn O. Pearce2009-03-091-0/+6
| | | | | | | | This has the same effect as saying "export REPO_TRACE=1" in your shell prior to starting repo, but is documented in the command usage and perhaps easier to use. Signed-off-by: Shawn O. Pearce <sop@google.com>
* Add repo manifest -o to save a manifestv1.6.2Shawn O. Pearce2009-03-053-13/+118
| | | | | | | | | This can be useful to create a new manifest from an existing client, especially if the client wants to use the "-r" option to set each project's revision to the current commit SHA-1, making a sort of a tag file that can be used to recreate this exact state elsewhere. Signed-off-by: Shawn O. Pearce <sop@google.com>
* Add a 'repo manifest' command whose help is the manifest file formatShawn O. Pearce2009-03-043-46/+99
| | | | | | | This should make it easier for users to discover the file format on their own, and read about it. Signed-off-by: Shawn O. Pearce <sop@google.com>
* Tell users how to see the complete list of commandsShawn O. Pearce2009-03-041-0/+1
| | | | | | Using "repo help --all" may not be obvious. Signed-off-by: Shawn O. Pearce <sop@google.com>
* Set core.bare to true on mirror repositoriesv1.6.1Shawn O. Pearce2009-03-031-1/+5
| | | | | | | | When creating a mirror repository we will always be using a bare repository. Setting $GIT_DIR/config to have core.bare = true is reasonable and helps Git to recognize the environment it is in. Signed-off-by: Shawn O. Pearce <sop@google.com>
* Allow repo forall -c on a mirror by using GIT_DIR as pwdShawn O. Pearce2009-03-031-4/+12
| | | | | | | We can permit a forall on a mirror, but only if we put the command into the git repository. Signed-off-by: Shawn O. Pearce <sop@google.com>
* Don't permit users to run repo status in a mirror clientShawn O. Pearce2009-03-036-9/+22
| | | | | | | | | | | | | | | | If a client was created with "repo init --mirror" then there are no working directories present, and no files checked out. Using a command like "repo status" in this context makes no sense, and actually throws back a Pytyon traceback at the console when the underlying commands fail out. We now tag commands with the MirrorSafeCommand type if they are able to be executed within a mirror directory safely. Using a command in a mirror which lacks this base class results in a useful error letting you know the command isn't supported. Bug: REPO-14 Signed-off-by: Shawn O. Pearce <sop@google.com>
* Get rid of the horrible android import work around hackShawn O. Pearce2009-03-031-25/+0
| | | | | | | | | | | | | | | | | | | Months ago when the Android Open Source Project launched we had some import errors that had to be fixed and worked over. These hacks were here to help users update their clients to newer versions of the imported code. Its very likely all clients have either been deleted, or have been updated and have the fixed imports. So we don't need this hack in repo anymore. If a very ancient client still existed, it would need to be created from scratch anyway, due to the Android cupcake branch merging into master and the manifest changes not being able to be handled correctly by repo. A new client wouldn't have the incorrectly imported code in it, and thus wouldn't need this hack. Signed-off-by: Shawn O. Pearce <sop@google.com>
* Fix repo status when there are renamed/copied filesShawn O. Pearce2009-03-031-1/+1
| | | | | | | | | I missed a parameter in the format string, but still provided the value in the parameter list, so the format failed to produce an output message. Bug: REPO-15 Signed-off-by: Shawn O. Pearce <sop@google.com>
* Export additional environment variables to repo forall:Jeff Bailey2009-03-021-0/+17
| | | | | | | | | | | | | | | REPO_PATH is the path relative the the root of the client. REPO_REMOTE is the name of the remote system from the manifest. REPO_LREV is the name of the revision from the manifest, but translated to something the local repository knows. REPO_RREV is the name of the revision from the manifest. This allows us to do commands like: repo forall -c 'echo "(cd $REPO_PATH && git checkout `git rev-parse HEAD`)"'
* Add 'repo version' to describe what code we are runningShawn O. Pearce2009-03-022-0/+45
| | | | | | | I meant to have this in here, so clients can more easily report what version of repo they are running. Signed-off-by: Shawn O. Pearce <sop@google.com>
* Report better errors when a project revision is invalidShawn O. Pearce2009-03-023-0/+15
| | | | | | | | | If a manifest specifies an invalid revision property, give the user a better error message detaling the problem, instead of an ugly Python traceback with a strange Git error message. Bug: REPO-2 Signed-off-by: Shawn O. Pearce <sop@google.com>
* Fix repo prune output to sort by branch nameShawn O. Pearce2009-03-021-1/+1
| | | | | | We didn't always sort the output. Now we do. Signed-off-by: Shawn O. Pearce <sop@google.com>
* Fix repo prune to work on git 1.6.1-rc3~5 and laterShawn O. Pearce2009-03-021-11/+8
| | | | | | | | | | | | | | | | | | | | | Prior to git 1.6.1-rc3~5 the output of 'git branch -d' matched: Deleted branch (.*)\. where the subgroup grabbed the branch name. In v1.6.1-rc3~5 (aka a126ed0a01e265d7f3b2972a34e85636e12e6d34) Brandon Casey changed the output to include the SHA-1 of the branch name, now matching the pattern: Deleted branch (.*) \([0-9a-f]*\)\. Instead of parsing the output of git branch we now re-obtain the list of branches after the deletion attempt and perform a set difference in memory to determine which branches we were able to successfully delete. Bug: REPO-9 Signed-off-by: Shawn O. Pearce <sop@google.com>
* Mergev1.6Android Code Review2009-02-101-19/+0
|\
| * Remove the now unnecessary MakefileShawn O. Pearce2009-01-261-19/+0
| | | | | | | | | | | | | | | | | | In a pure Python project run directly from source we really don't have a need for a Makefile. Previously it held the rule to update the protobuf client from Gerrit1, but now that we have retired that logic we don't need it anymore. Signed-off-by: Shawn O. Pearce <sop@google.com>
* | MergeAndroid Code Review2009-02-1025-6287/+1
|\|
| * Remove the protobuf based HTTP upload code pathShawn O. Pearce2009-01-2625-6287/+1
| | | | | | | | | | | | | | | | | | Now that Gerrit2 has been released and the only supported upload protocol is direct git push over SSH we no longer need the large and complex protobuf client library, or the upload chunking logic in gerrit_upload.py. Signed-off-by: Shawn O. Pearce <sop@google.com>
* | Fix color parsing to not crash when user defined colors are setv1.5.1Shawn O. Pearce2009-02-021-1/+1
|/ | | | | | | | | | | We didn't use the right Python string methods to parse colors. $ git config --global color.status.added yellow managed to cause a stack trace due to undefined methods trim() and lowercase(). Instead use strip() and lower(). Signed-off-by: Shawn O. Pearce <sop@google.com>
* Support Gerrit2's ssh:// based uploadv1.5Shawn O. Pearce2009-01-052-24/+91
| | | | | | | | | | | In Gerrit2 uploads are sent over "git push ssh://...", as this is a more efficient transport and is easier to code from external scripts and/or direct command line usage by an end-user. Gerrit1's HTTP POST based format is assumed if the review server does not have the /ssh_info URL available on it. Signed-off-by: Shawn O. Pearce <sop@google.com>
* Remove astray commav1.4.4Marcelo E. Magallon2008-12-311-1/+1
| | | | | | | | | | | | There's an extra "," at the end of the line, which is causing trouble when the manifest file specifies a revision for a project. Since the default manifest file doesn't specify revisions for the projects, the problem has gone unnoticed. Thanks to Barry Silverman <barry@disus.com> for spotting the issue and providing a patch. Signed-off-by: Marcelo E. Magallon <marcelo.magallon@gmail.com>
* Correct the REPO_URL in the wrapper script to android.git.kernel.orgv1.4.3Shawn O. Pearce2008-12-181-2/+2
| | | | Signed-off-by: Shawn O. Pearce <sop@google.com>