summaryrefslogtreecommitdiffstats
path: root/subcmds
Commit message (Collapse)AuthorAgeFilesLines
* sync: Keep the project.list file sortedShawn O. Pearce2009-06-041-0/+1
| | | | | | Its easier to locate an entry visually if the file is sorted. Signed-off-by: Shawn O. Pearce <sop@google.com>
* sync: Tolerate blank lines in project.listv1.6.8.1Shawn O. Pearce2009-06-041-1/+5
| | | | | | | | If a line is blank in project.list, its not a relevant project path, so skip over it. Existing project.list files may have blank lines if sync was run with no projects at all, and the file was created empty. Signed-off-by: Shawn O. Pearce <sop@google.com>
* sync: Don't process project.list in a mirrorShawn O. Pearce2009-06-041-0/+4
| | | | | | | | | We have no working tree, so we cannot update the project.list state file, nor should we try to delete a directory if a project is removed from the manifest. Clients would still need the repository for historical records. Signed-off-by: Shawn O. Pearce <sop@google.com>
* Delete empty parent subdirs after deleting obsolete paths.v1.6.8Jaikumar Ganesh2009-06-021-0/+8
| | | | | | After sync, we delete obsolete project paths. Iterate and delete parent subdirs which are empty. Tested on projects within subdirectories.
* Update project paths after sync.Jaikumar Ganesh2009-06-021-0/+48
| | | | | | After a repo sync, some of the project paths might need to be removed. This changes maintains a list of project paths from the previous sync operation and compares.
* Change project.revision to revisionExpr and revisionIdShawn O. Pearce2009-05-293-12/+7
| | | | | | | | | The revisionExpr field now holds an expression from the manifest, such as "refs/heads/master", while revisionId holds the current commit-ish SHA-1 of the revisionExpr. Currently that is only filled in if the manifest points directly to a SHA-1. Signed-off-by: Shawn O. Pearce <sop@google.com>
* Refactor how projects parse remotes so it can be replacedShawn O. Pearce2009-05-291-1/+0
| | | | | | | | | We now feed Project a RemoteSpec, instead of the Remote directly from the XmlManifest. This way the RemoteSpec already has the full project URL, rather than just the base, permitting other types of manifests to produce the URL in their own style. Signed-off-by: Shawn O. Pearce <sop@google.com>
* Make 'repo branches -a' the default behaviorv1.6.7.5Shawn O. Pearce2009-05-181-18/+1
| | | | | | | Extensive discussion with users lead to the fact that needing to supply -a to view what they really wanted to see was just wrong. Signed-off-by: Shawn O. Pearce <sop@google.com>
* Automatically guess Gerrit change number in "repo upload --replace"v1.6.7.4Ficus Kirkpatrick2009-05-051-2/+20
| | | | | This feature only works if you have one commit to replace right now (the common case).
* Require a project or '--all' to be specified when using 'repo start'.Ficus Kirkpatrick2009-04-221-2/+14
|
* Change -p command to use stdout instead of stderr.Wink Saville2009-04-211-1/+1
|
* Document the SSH ControlMaster behavior of repo syncShawn O. Pearce2009-04-211-0/+29
| | | | Signed-off-by: Shawn O. Pearce <sop@google.com>
* Support a level 2 heading in help description textShawn O. Pearce2009-04-211-3/+13
| | | | | | | | The level 2 headings (denoted by ~) indent the heading two spaces, but continue to use the bold formatter to offset them from the other surrounding text. Signed-off-by: Shawn O. Pearce <sop@google.com>
* Make 'repo status' show the branch you are currently onShawn O. Pearce2009-04-181-0/+13
| | | | Signed-off-by: Shawn O. Pearce <sop@google.com>
* Print '(no branches)' if the output of `repo branches` is emptyShawn O. Pearce2009-04-181-0/+4
| | | | | | | | This way its clear the command did something, and reported that it had nothing to show you, because you have no active branches in this client. Signed-off-by: Shawn O. Pearce <sop@google.com>
* Modify 'repo abandon' to be more like 'repo checkout' and 'repo start'Shawn O. Pearce2009-04-181-2/+21
| | | | Signed-off-by: Shawn O. Pearce <sop@google.com>
* Improve checkout performance for the common unmodified caseShawn O. Pearce2009-04-182-12/+24
| | | | | | | | | Most projects will have their branch heads matching in all branches, so switching between them should be just a matter of updating the work tree's HEAD symref. This can be done in pure Python, saving quite a bit of time over forking 'git checkout'. Signed-off-by: Shawn O. Pearce <sop@google.com>
* Add progress meter to 'repo start'Shawn O. Pearce2009-04-181-1/+7
| | | | | | | | | | This is mostly useful if the number of projects to switch is many (e.g. all of Android) and a large number of them are behind the current manifest revision. We wind up needing to run git just to make the working tree match, and that often makes the command take a couple of seconds longer than we'd like. Signed-off-by: Shawn O. Pearce <sop@google.com>
* Add -p to `repo forall` to improve output formattingShawn O. Pearce2009-04-181-3/+138
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | When trying to read log output from many projects at once it can be difficult to make sense of which messages came from where. For many professional developers it is common to want to view the last week's worth of your work, so you can write a weekly summary of your activity for your status report. This is easier with the new -p option: repo forall -pc git log --reverse --since=1.week.ago --author=sop produces a report of all commits written by me in the last week, formatted in a paged output display, with headers inserted in front of each project's output. Where this can be even more useful is with git log's pickaxe, e.g. now we can use: repo forall -pc git log -Sbar v1.0..v1.1 to locate all additions or removals of the symbol 'bar' since v1.0, up to and including v1.1. Before displaying the matching commits in a project, a project header is shown, giving the user some context information for the matching results. Signed-off-by: Shawn O. Pearce <sop@google.com>
* Clarify the option section header in 'repo help grep'Shawn O. Pearce2009-04-181-2/+2
| | | | Signed-off-by: Shawn O. Pearce <sop@google.com>
* Show options help after the summary for a commandShawn O. Pearce2009-04-181-1/+1
| | | | | | It is a bit clearer to read this way. Signed-off-by: Shawn O. Pearce <sop@google.com>
* Improve the help text for 'repo init'Shawn O. Pearce2009-04-181-3/+14
| | | | Signed-off-by: Shawn O. Pearce <sop@google.com>
* Clarify options that control the repo executable versionShawn O. Pearce2009-04-183-5/+7
| | | | Signed-off-by: Shawn O. Pearce <sop@google.com>
* Only display project path in 'repo stage -i'Shawn O. Pearce2009-04-181-2/+2
| | | | | | | Generally we only show the project path, relative from the top of the client. Showing the project name may be confusing for the end-user. Signed-off-by: Shawn O. Pearce <sop@google.com>
* Improve the help text for 'repo start'Shawn O. Pearce2009-04-181-14/+4
| | | | Signed-off-by: Shawn O. Pearce <sop@google.com>
* Display the URL we will upload changes to for reviewShawn O. Pearce2009-04-181-1/+1
| | | | | | | | This gives the user the last chance to confirm where the change is going to be sent to. Knowing the review server URL will help the user decide if continuing with the upload makes sense. Signed-off-by: Shawn O. Pearce <sop@google.com>
* Improve the help text for 'repo upload'Shawn O. Pearce2009-04-181-13/+17
| | | | Signed-off-by: Shawn O. Pearce <sop@google.com>
* Only fetch repo once-per-day under normal 'repo sync' usageShawn O. Pearce2009-04-181-3/+11
| | | | | | | | | | | Its unlikely that a new version of repo will be delivered in any given day, so we now check only once every 24 hours to see if repo has been updated. This reduces the sync cost, as we no longer need to contact the repo distribution servers every time we do a sync. repo selfupdate can still be used to force a check. Signed-off-by: Shawn O. Pearce <sop@google.com>
* Only compute commits in repo upload if we need to show a promptShawn O. Pearce2009-04-171-2/+3
| | | | | | | | If the user has disabled a prompt, skip the two commands we use to obtain the list of commits and the date of the branch. These will never be displayed and just waste the end-user's time. Signed-off-by: Shawn O. Pearce <sop@google.com>
* Allow review.URL.autoupload to skip prompting during `repo upload`Shawn O. Pearce2009-04-171-12/+44
| | | | | | | | | | | | If review.URL.autoupload is set to true in a project's .git/config or in ~/.gitconfig then `repo upload` will automatically upload, and skip prompting the end-user. Conversely, if review.URL.autoupload is set to false, then repo will refuse to upload to that project. Bug: REPO-25 Signed-off-by: Shawn O. Pearce <sop@google.com>
* Change repo sync to be more friendly when updating the treev1.6.6Shawn O. Pearce2009-04-162-6/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | We now try to sync all projects that can be done safely first, before we start rebasing user commits over the upstream. This has the nice effect of making the local tree as close to the upstream as possible before the user has to start resolving merge conflicts, as that extra information in other projects may aid in the conflict resolution. Informational output is buffered and delayed until calculation for all projects has been done, so that the user gets one concise list of notice messages, rather than it interrupting the progress meter. Fast-forward output is now prefixed with the project header, so the user can see which project that update is taking place in, and make some relation of the diffstat back to the project name. Rebase output is now prefixed with the project header, so that if the rebase fails, the user can see which project we were operating on and can try to address the failure themselves. Since rebase sits on a detached HEAD, we now look for an in-progress rebase during sync, so we can alert the user that the given project is in a state we cannot handle. 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-101-2/+9
| | | | | | | | | 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-101-1/+8
| | | | | | | | 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-101-1/+15
| | | | | | | | | | 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-102-2/+12
| | | | | | | | | | | | | | | | | | | | 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>
* Add a repo branches subcommand to describe current branchesShawn O. Pearce2009-04-101-0/+150
| | | | | | | | 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-101-0/+45
| | | | | | | Teach repo how to checkout a branch in all projects or a list of specific projects. Bug: REPO-21
* 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>