summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* manifest: Only support -o option on XML formatted manifestShawn O. Pearce2009-07-031-11/+14
| | | | | | | | If the manifest isn't a single file format manifest, the -o option makes no sense, as you cannot export multiple files to a single stream for display or redirection. Signed-off-by: Shawn O. Pearce <sop@google.com>
* manifest: Only display XML help on XML manifestShawn O. Pearce2009-07-032-8/+13
| | | | | | | Some of the help text is only related to the XML formatted manifest, so only display that text if that is the current format. Signed-off-by: Shawn O. Pearce <sop@google.com>
* help: Don't show empty Summary or Description sectionsShawn O. Pearce2009-07-031-0/+2
| | | | Signed-off-by: Shawn O. Pearce <sop@google.com>
* Create an abstract Manifest base classShawn O. Pearce2009-07-037-39/+99
| | | | | | This will help as we add support for another manifest type. Signed-off-by: Shawn O. Pearce <sop@google.com>
* Teach Project how to relink a .git/ in the work treeShawn O. Pearce2009-07-031-21/+28
| | | | | | | | The _LinkWorkTree method can now be used to relink the work tree, such as if the real repository was moved to a different location on disk. Signed-off-by: Shawn O. Pearce <sop@google.com>
* Allow callers to reset the git config cacheShawn O. Pearce2009-07-031-0/+8
| | | | | | | | | | | | If commands modify the git config too rapidly we might not notice the .git/config file has been modified, as they could run in the same filesystem timestamp window and thus not cause a change on the config's mtime. This can cause repo to miss re-reading the config file after running a command. Allowing the cache to be flushed forces us to re-read the config. Signed-off-by: Shawn O. Pearce <sop@google.com>
* 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>
* Add missing return False to preconnectShawn O. Pearce2009-06-121-0/+1
| | | | | | | | Noticed by users on repo-discuss, we were missing a return False here to signal that SSH control master was not used to setup the network connection. Signed-off-by: Shawn O. Pearce <sop@google.com>
* 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>
* Silence 'Current branch %s is up to date' during syncShawn O. Pearce2009-06-031-3/+1
| | | | | | | | We accidentally introduced this message during 1.6.8 by always invoking `git rebase` when there were no new commits from the upstream, but the user had local commits. 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.
* Fix unnecessary self in project.pyShawn O. Pearce2009-06-011-1/+1
| | | | Signed-off-by: Shawn O. Pearce <sop@google.com>
* Add PyDev project files to repoKis Gergely2009-06-022-0/+27
|
* Change project.revision to revisionExpr and revisionIdShawn O. Pearce2009-05-295-118/+113
| | | | | | | | | 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>
* Change DWIMery hack for dealing with rewound remote branchShawn O. Pearce2009-05-291-35/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | The trick of looking at the reflog for the remote tracking branch and only going back one commit works some of the time, but not all of the time. Its sort of relying on the fact that the user didn't use `repo sync -n` or `git fetch` to only update the tracking branches and skip the working directory update. Doing this right requires looking through the history of the SHA-1 source (what the upstream used to be) and finding a spot where the DAG diveraged away suddenly, and consider that to be the rewind point. That's really difficult to do, as we don't have a clear picture of what that old point was. A close approximation is to list all of the commits that are in HEAD, but not the new upstream, and rebase all of those where the committer email address is this user's email address. In most cases, this will effectively rebase only the user's new original work. If the user is the project maintainer and rewound the branch themselves, and they don't want all of the commits they have created to be rebased onto the new upstream, they should handle the rebase on their own, after the sync is complete. Signed-off-by: Shawn O. Pearce <sop@google.com>
* Refactor how projects parse remotes so it can be replacedShawn O. Pearce2009-05-294-41/+33
| | | | | | | | | 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>
* Refactor Manifest to be XmlManifestShawn O. Pearce2009-05-293-4/+4
| | | | | | | | We'll soon be supporting two different manifest formats, but we can't immediately remove support for the current XML one that is in wide spread use within Android. Signed-off-by: Shawn O. Pearce <sop@google.com>
* Allow callers of GitConfig to specify the pickle file pathShawn O. Pearce2009-05-291-4/+8
| | | | | | | | This way we can put it in another directory than the config file itself, e.g. hide it inside ".git" when parsing a ".gitmodules" file from the working tree. Signed-off-by: Shawn O. Pearce <sop@google.com>
* Teach GitConfig how to yield subsection namesShawn O. Pearce2009-05-191-0/+5
| | | | | | | This can be useful when pulling apart a configuration file, like finding all entries which match submodule.*.*. Signed-off-by: Shawn O. Pearce <sop@google.com>
* Remove support for the extra <remote> definitions in manifestsShawn O. Pearce2009-05-194-91/+5
| | | | | | | | | These aren't that widely used, and actually make it difficult for users to fully mirror a forest of repositories, and then permit someone else to clone off that forest, rather then the original upstream servers. Signed-off-by: Shawn O. Pearce <sop@google.com>
* Remove unused parsing support for <require commit=""/>Shawn O. Pearce2009-05-192-6/+0
| | | | | | | We haven't supported this in a while, but the parser was still here. Its all dead code, so strip it out. 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-052-2/+33
| | | | | This feature only works if you have one commit to replace right now (the common case).
* Fix ssh://user@hostname/ style URLs parsingv1.6.7.3Shawn O. Pearce2009-04-301-1/+1
| | | | | | | | I only tested this with ssh://hostname/ style URLs, so I failed to test ssh://user@hostname/ format, which failed if the hostname portion was longer than 1 character. Signed-off-by: Shawn O. Pearce <sop@google.com>
* Disable SSH ControlMaster option on CygwinShawn O. Pearce2009-04-231-1/+1
| | | | | Bug: REPO-29 Signed-off-by: Shawn O. Pearce <sop@google.com>
* Require a project or '--all' to be specified when using 'repo start'.Ficus Kirkpatrick2009-04-221-2/+14
|
* Fix UnboundLocalError: local variable 'port' when using SSHv1.6.7.2Shawn O. Pearce2009-04-211-5/+4
| | | | | | | | | If the SSH URL doesn't contain a port number, but uses the ssh:// or git+ssh:// syntax we raised a Python runtime error due to the 'port' local variable not being assigned a value. Default it to the IANA assigned port for SSH, 22. Signed-off-by: Shawn O. Pearce <sop@google.com>
* Perform copy file activity when creating a new work directoryv1.6.7.1Shawn O. Pearce2009-04-211-0/+1
| | | | | | | | | | | | Performance improvements in repo sync caused us to skip out of the initial Sync_LocalHalf without ever running CopyFiles, so we didn't create the top level Makefile in new clients whose manifest request one with a <copyfile> element. Now we run CopyFiles after the initial read-tree that populates the project working directory. Signed-off-by: Shawn O. Pearce <sop@google.com>
* Change -p command to use stdout instead of stderr.Wink Saville2009-04-211-1/+1
|
* Fix 'repo sync' rebase logic on a published branchv1.6.7Shawn O. Pearce2009-04-211-6/+3
| | | | | | | | | If the current branch is published, but all published commits are merged into the manifest revision, but there is also at least one unpublished commit on the current branch, we should rebase the unpublished commit, rather than creating a merge commit. Signed-off-by: Shawn O. Pearce <sop@google.com>
* 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>
* Work around 'ControlPath too long' on Mac OS XShawn O. Pearce2009-04-211-1/+4
| | | | | | | | | | | | Mac OS X sets TMPDIR to a very long path within /var, so long that a socket created in that location is too big for a struct sockaddr_un on the platform, resulting in OpenSSH being unable to create or bind to a socket in that location. Instead we try to use the very short and very common /tmp, but fall back to the guessed default if /tmp does not exist. Signed-off-by: Shawn O. Pearce <sop@google.com>
* Fix launching of editor under 'repo upload --replace'Shawn O. Pearce2009-04-181-3/+3
| | | | Signed-off-by: Shawn O. Pearce <sop@google.com>