summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Add pylint configuration and instructionsDavid Pursehouse2012-10-245-7/+316
| | | | | | | | | | pylint configuration file (.pylintrc) is added, and submission instructions are updated to include pylint usage steps. Deprecated pylint suppression (`disable-msg`) is updated in a few modules to make it work properly with the latest version (0.26). Change-Id: I4ec2ef318e23557a374ecdbf40fe12645766830c
* Represent git-submodule as nested projectsChe-Liang Chiou2012-10-235-55/+341
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We need a representation of git-submodule in repo; otherwise repo will not sync submodules, and leave workspace in a broken state. Of course this will not be a problem if all projects are owned by the owner of the manifest file, who may simply choose not to use git-submodule in all projects. However, this is not possible in practice because manifest file owner is unlikely to own all upstream projects. As git submodules are simply git repositories, it is natural to treat them as plain repo projects that live inside a repo project. That is, we could use recursively declared projects to denote the is-submodule relation of git repositories. The behavior of repo remains the same to projects that do not have a sub-project within. As for parent projects, repo fetches them and their sub-projects as normal projects, and then checks out subprojects at the commit specified in parent's commit object. The sub-project is fetched at a path relative to parent project's working directory; so the path specified in manifest file should match that of .gitmodules file. If a submodule is not registered in repo manifest, repo will derive its properties from itself and its parent project, which might not always be correct. In such cases, the subproject is called a derived subproject. To a user, a sub-project is merely a git-submodule; so all tips of working with a git-submodule apply here, too. For example, you should not run `repo sync` in a parent repository if its submodule is dirty. Change-Id: I541e9e2ac1a70304272dbe09724572aa1004eb5c
* More coding style cleanupDavid Pursehouse2012-10-2210-28/+54
| | | | | | | | | | | | | | | | Fixing more issues found with pylint. Some that were supposed to have been fixed in the previous sweep (Ie0db839e) but were missed: C0321: More than one statement on a single line W0622: Redefining built-in 'name' And some more: W0631: Using possibly undefined loop variable 'name' W0223: Method 'name' is abstract in class 'name' but is not overridden W0231: __init__ method from base class 'name' is not called Change-Id: Ie119183708609d6279e973057a385fde864230c3
* Support HTTP authentication using user input as fallbackJoonCheol Park2012-10-121-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If repo could not find authentication credentials from ~/.netrc, this patch tries to get user and password from user's console input. This could be a good choice if user doesn't want to save his plain password in ~/.netrc or if user doesn't know about the netrc usage. The user will be prompted only if authentication infomation does not exist in the password manager. Since main.py firstly loads auth infomation from ~/.netrc, this will be executed only as fallback mechanism. Example: $ repo upload . Upload project xxx/ to remote branch master: branch yyy ( 1 commit, ...): to https://review.zzz.com/gerrit/ (y/N)? y (repo may try to access to https://review.zzz.com/gerrit/ssh_info and will get the 401 HTTP Basic Authentication response from server. If no authentication info in ~/.netrc, This patch will ask username/passwd) Authorization Required (Message from Web Server) User: pororo Password: .... [OK ] xxx/ Change-Id: Ia348a4609ac40060d9093c7dc8d7c2560020455a
* Rename "dir" variablesMickaël Salaün2012-10-105-28/+28
| | | | | | | The variable name "dir" conflicts with the name of a Python built-in function: http://docs.python.org/library/functions.html#dir Change-Id: I850f3ec8df7563dc85e21f2876fe5e6550ca2d8f
* Merge "Coding style cleanup"Conley Owens2012-10-0922-172/+167
|\
| * Coding style cleanupDavid Pursehouse2012-10-0922-172/+167
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix the following issues reported by pylint: C0321: More than one statement on a single line W0622: Redefining built-in 'name' W0612: Unused variable 'name' W0613: Unused argument 'name' W0102: Dangerous default value 'value' as argument W0105: String statement has no effect Also fixed a few cases of inconsistent indentation. Change-Id: Ie0db839e7c57d576cff12d8c055fe87030d00744
* | Merge "Expand ~ to user's home directory for --reference"Conley Owens2012-10-091-0/+4
|\ \ | |/ |/|
| * Expand ~ to user's home directory for --referenceVictor Boivie2012-10-081-0/+4
| | | | | | | | | | | | | | This allows a user to have a 'repo init' as: $ repo init -u ... --reference=~/mirror Change-Id: Ib85b7c8ffca9d732132c68fe9a8d7f0ab1fa9288
* | Remove unreachable codeDavid Pursehouse2012-10-051-8/+0
|/ | | | | | | Change 9bb1816b removed part of a block of code, but left the remaining part unreachable. Remove it. Change-Id: Icdc6061d00e6027df32dee9a3bad3999fe7cdcbc
* Update commit-msg hook to version from Gerrit v2.5-rc0David Pursehouse2012-10-041-40/+113
| | | | Change-Id: I0d11ac0c24cd53386e996b7dd9bd37c89c789f60
* Correct call to `sys.exit()`David Pursehouse2012-10-041-1/+1
| | | | | | It should be `sys.exit()` not `os.exit()`. Change-Id: Iaeeef456ddf2d17f5df2b712e50e3630bed856c3
* Remove `ImportError` classDavid Pursehouse2012-10-041-9/+0
| | | | | | | | | The definition of `ImportError` redefines the Python built-in class of the same name. It is not used anywhere, so remove it. Change-Id: I557ce28c93a3306fff72873dc6f477330fc33128
* Merge "manifest: record the original revision when in -r mode."Conley Owens2012-10-033-17/+55
|\
| * manifest: record the original revision when in -r mode.Brian Harring2012-09-283-17/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently when doing a sync against a revision locked manifest, sync has no option but to fall back to sync'ing the entire refs space; it doesn't know which ref to ask for that contains the sha1 it wants. This sucks if we're in -c mode; thus when we generate a revision locked manifest, record the originating branch- and try syncing that branch first. If the sha1 is found within that branch, this saves us having to pull down the rest of the repo- a potentially heavy saving. If that branch doesn't have the desired sha1, we fallback to sync'ing everything. Change-Id: I99a5e44fa1d792dfcada76956a2363187df94cf1
* | Fix incorrect default_groups when parsing projects from XML manifestDavid Holmer2012-09-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Change Details: * Switch first default group to 'all' instead of 'default' Change Benefits: * More consistent with default_groups in the counterpart Save() function * Fixes bug where command 'repo manifest' added an extra 'default' group to every output project element groups attribute. This bug was particularly confusing for projects which had 'groups="notdefault"' as they were output as 'groups="notdefault,default"' by 'repo manifest' Change-Id: I5611c027a982d3394899466248b971910bec8c6b
* | sync: Support manual authentication to the manifest serverDavid Pursehouse2012-09-211-19/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add two new command line options, -u/--manifest-server-username and -p/--manifest-server-password, which can be used to specify a username and password to authenticate to the manifest server when using the -s/--smart-sync or -t/--smart-tag option. If -u and -p are not specified when using the -s or -t option, use authentication credentials from the .netrc file (if there are any). Authentication credentials from -u/-p or .netrc are not used if the manifest server specified in the manifest file already includes credentials. Change-Id: I6cf9540d28f6cef64c5694e8928cfe367a71d28d
* | Clean up importsDavid Pursehouse2012-09-185-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | manifest_xml: import `HEAD` and `R_HEADS` from correct module version: import `HEAD` from correct module `HEAD` and `R_HEADS` should be imported from the git_refs module, where they are originally defined, rather than from the project module. repo: remove unused import of readline cherry_pick: import standard modules on separate lines smartsync: import subcmd modules explicitly from subcmd Use: `import re import sys` and `from subcmds.sync import Sync` Instead of: `import sys, re` and `from sync import Sync` Change-Id: Ie10dd6832710939634c4f5c86b9ba5a9cd6fc92e
* | sync: Support authentication to manifest server with .netrcDavid Pursehouse2012-09-111-1/+29
|/ | | | | | | | | | | | | | | | | | | | When using the --smart-sync or --smart-tag option, and the specified manifest server is hosted on a server that requires authentication, repo sync fails with the error: HTTP 401 Unauthorized. Add support for getting the credentials from the .netrc file. If a .netrc file exists in the user's home directory, and it contains credentials for the hostname of the manifest server specified in the manifest, use the credentials to authenticate with the manifest server using the URL syntax extension for Basic Authentication: http://user:password@host:port/path Credentials from the .netrc file are only used if the manifest server URL specified in the manifest does not already include credentials. Change-Id: I06e6586e8849d0cd12fa9746789e8d45d5b1f848
* Fix ManifestParseError when first child node is commentv1.10.4Jooncheol Park2012-09-071-3/+5
| | | | | | | | | | | | If the first line of manifest.xml is a XML comment, root.childNodes[0] is not a 'manifest' element node. The python minidom module will makes a 'Comment' node as root.childNodes[0]. Since the original code only checks whether the first child node is 'manifest', it couldn't do any command including 'sync' due to the 'ManifestParseError' exception. This patch could allow the comments between '<?xml ...?>' and '<manifest>' in the manifest.xml file. Change-Id: I0b81dea4f806965eca90f704c8aa7df49c579402
* sync: Correct imports of `R_HEADS` and `HEAD`David Pursehouse2012-09-071-3/+1
| | | | | | | | | | | | | | `R_HEADS` is imported twice, from both the git_refs and project modules. It is actually defined in git_refs, and in project it is imported from there, so the import of `R_HEADS` from project in the sync module is redundant. Remove it. `HEAD` is imported from project, but like `R_HEADS` it is actually defined in git_refs. Import it from git_refs instead. Change-Id: I8e2b0217d0d9f9f4ee5ef5b8cd0b026174ac52f4
* sync: catch exceptions when connecting to the manifest serverDavid Pursehouse2012-09-061-3/+7
| | | | | | | | | | | | | | | | | When connecting to the manifest server, exceptions can occur but are not caught, resulting in the repo sync exiting with a python traceback. Add handling of the following exceptions: - IOError, which can be raised for example if the manifest server URL is malformed. - xmlrpclib.ProtocolError, which can be raised if the connection to the manifest server fails with HTTP error. - xmlrpclib.Fault, which can be raised if the RPC call fails for some other reason. Change-Id: I3a4830aef0941debadd515aac776a3932e28a943
* Fix errors when clone.bundle missing on serverMatt Gumbel2012-09-061-3/+13
| | | | | | | | | | | | | Catch curl failures to download clone.bundle; don't let git try to parse the 404 page as a bundle file (was causing much user confusion). This should eliminate false error messages from init and sync such as: error: '.repo/manifests.git/clone.bundle' does not look like a v2 bundle file fatal: Could not read bundle '.repo/manifests.git/clone.bundle'. error: RPC failed; result=22, HTTP code = 400 Signed-off-by: Matt Gumbel <matthew.k.gumbel@intel.com> Change-Id: I7994f7c0baecfb45bb5a5850c48bd2a0ffabe773
* Allow projects to be specified as notdefaultConley Owens2012-09-055-16/+18
| | | | | | | | | | | | Instead of every group being in the group "default", every project is now in the group "all". A group that should not be downloaded by default may be added to the group "notdefault". This allows all group names to be positive (instead of removing groups directly in the manifest with -default) and offers a clear way of selecting every project (--groups all). Change-Id: I99cd70309adb1f8460db3bbc6eff46bdcd22256f
* Make "repo sync -j<count>" stop properly on Ctrl-C.David 'Digit' Turner2012-09-052-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | The threaded 'repo sync' implementation would very often freeze the process when interrupted by the user with Ctrl-C. The only solution being to kill -9 the process explicitly from another terminal. The reason for this is best explained here: http://snakesthatbite.blogspot.fr/2010/09/cpython-threading-interrupting.html This patch makes all helper sync threads 'daemon', which allows the process to terminate immediately on Ctrl-C. Note that this will forcefully kill all threads in case of interruption; this is generally a bad thing, but: 1/ This is equivalent to calling kill -9 in another terminal, which is the _only_ thing that can currently stop the process. 2/ There doesn't seem to be a way to tell the worker threads to gently stop when they are in a blocking operation anyway (even in the non-threaded case). + Do the same for "repo status -j<count>". Change-Id: Ieaf45b0eacee36f35427f8edafd87415c2aa7be4
* manifest-format.txt: Add documentation for GetManifest RPC methodDavid Pursehouse2012-09-051-4/+10
| | | | | | | Add documentation of the GetManifest RPC method in the manifest-server section. Change-Id: I5cda5929bc8a0ca9d3f2b9da63216427041d2823
* `repo manifest`: default to stdout if no "-o"Conley Owens2012-09-041-0/+1
| | | | Change-Id: I1b0ff9ed5df6386f0c2a851c6c48d063199fe663
* init: Improved help text for the --mirror optionDavid Pursehouse2012-08-231-1/+2
| | | | Change-Id: Ia6032865f9296b29524c2c25b72bd8e175b30489
* Remove unused importsDavid Pursehouse2012-08-239-12/+3
| | | | | | There are several imports that are not used. Remove them. Change-Id: I2ac3be66827bd68d3faedcef7d6bbf30ea01d3f2
* manifest-format.txt: Fix a couple of minor spelling mistakesDavid Pursehouse2012-08-221-2/+2
| | | | Change-Id: Ic2d266c8cf08827a71846db9d3711feb02885f01
* Patches should be submitted to master, not maintDavid Pursehouse2012-08-211-2/+2
| | | | | | Update SUBMITTING_PATCHES accordingly. Change-Id: I6fd57a84c67d3762f1f23276d95cac2aeecd5e8f
* Merge branch 'master' into maintConley Owens2012-08-140-0/+0
|\ | | | | | | | | | | | | master's original purpose was to forge ahead on using git submodules, but this route has been abandoned. Change-Id: I164a9efc7821bcd1b941ad76649764722046081b
| * Merge branch 'stable'Shawn O. Pearce2011-01-101-1/+4
| |\ | | | | | | | | | | | | * stable: Fix mirror clients with no worktree
| * \ Merge branch 'stable'Shawn O. Pearce2011-01-101-1/+1
| |\ \ | | | | | | | | | | | | | | | | * stable: Bump repo version to 1,10
| * \ \ Merge branch 'maint'Shawn O. Pearce2011-01-090-0/+0
| |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * maint: help: Don't show empty Summary or Description sections sync: Run `git gc --auto` after fetch Add "repo branch" as an alias for "repo branches" upload: Catch and cleanly report connectivity errors forall: Silently skip missing projects Fix to display the usage message of the command download when the user don't provide any arguments to 'repo download'. Use os.environ.copy() instead of dict() Make path references OS independent
| * \ \ \ Merge branch 'stable'Shawn O. Pearce2011-01-094-14/+18
| |\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable: Encode the environment variables passed to git Exit with statuscode 0 for repo help init
| * \ \ \ \ Merge branch 'stable'Shawn O. Pearce2010-12-222-61/+90
| |\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable: Fixed race condition in 'repo sync -jN' that would open multiple masters.
| * \ \ \ \ \ Merge branch 'stable'Shawn O. Pearce2010-12-0719-179/+806
| |\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable: (33 commits) Added feature to print a <notice> from manifest at the end of a sync. sync: Use --force-broken to continue other projects upload: Remove --replace option sync --quiet: be more quiet sync: Enable use of git clone --reference Only delete corrupt pickle config files if they exist Don't allow git fetch to start ControlMaster Check for existing SSH ControlMaster Fix for handling values of EDITOR which contain a space. upload: Fix --replace flag rebase: Pass through more options upload: Allow review.HOST.username to override email upload -t: Automatically include local branch name Warn users before uploading if there are local changes sync: Try fetching a tag as a last resort before giving up rebase: Automatically rebase branch on upstrea upload: Automatically --cc folks in review.URL.autocopy Fix format string bugs in grep Do not invoke ssh with -p argument when no port has been specified. Allow files to be copied into new folders ... Conflicts: git_config.py manifest_xml.py subcmds/init.py subcmds/sync.py subcmds/upload.py Change-Id: I4756a6908277e91505c35287a122a775b68f4df5
| * | | | | | | Use os.environ.copy() instead of dict()Shawn O. Pearce2010-12-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Shawn O. Pearce <sop@google.com>
| * | | | | | | Make path references OS independentAnthony Newnam2010-11-294-6/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I5573995adfd52fd54bddc62d1d1ea78fb1328130
| * | | | | | | Merge branch 'stable'Shawn O. Pearce2010-03-064-30/+83
| |\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * stable: Automatically install Gerrit Code Review's commit-msg hook Fail sync when encountering "N commits behind." Check that we are not overwriting a local repository when syncing. Honor url.insteadOf when setting up SSH control master connection sync: Fix split call on malformed email addresses Fixing project renaming bug. Conflicts: hooks/commit-msg project.py subcmds/sync.py Change-Id: I5eaf8fef8cbe4a95d124368112293a9ca64325bf
| * | | | | | | | Fix to display the usage message of the command download when the userThiago Farina2009-09-091-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | don't provide any arguments to 'repo download'. Signed-off-by: Thiago Farina <thiago.farina@gmail.com>
| * | | | | | | | commit-msg: Don't create message with only Change-IdShawn O. Pearce2009-08-251-6/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a user aborts a commit, the commit-msg hook is still called, but with an empty file. We need to leave the empty file alone. Change-Id: I13766135dac267823cb08ab76f67d2000ba2d1ce Signed-off-by: Shawn O. Pearce <sop@google.com>
| * | | | | | | | commit-msg: Update the commit message hookShawn O. Pearce2009-08-221-2/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This version fixes a bug where Change-Id lines become the subject line, if the subject used a pattern like the subject of this message does. Change-Id: I7f7e0363091d03eb05dead2992fc19763214de65 Signed-off-by: Shawn O. Pearce <sop@google.com>
| * | | | | | | | forall: Silently skip missing projectsShawn O. Pearce2009-08-221-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>
| * | | | | | | | upload: Catch and cleanly report connectivity errorsShawn O. Pearce2009-08-222-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>
| * | | | | | | | upload: Document --replace is deprecatedShawn O. Pearce2009-08-221-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I52715bcfec9c038d0e02505aa7e4054ebc0434aa Signed-off-by: Shawn O. Pearce <sop@google.com>
| * | | | | | | | Automatically install Gerrit Code Review's commit-msg hookShawn O. Pearce2009-08-222-4/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. Change-Id: Ide42e93b068832f099d68a79c2863d22145d05ad Signed-off-by: Shawn O. Pearce <sop@google.com>
| * | | | | | | | Merge change 11206Shawn O. Pearce2009-08-171-5/+12
| |\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * change 11206: Do not invoke ssh with -p argument when no port has been specified.
| | * | | | | | | | Do not invoke ssh with -p argument when no port has been specified.Josh Guilfoyle2009-08-161-5/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change allows local SSH configuration to choose the port number to use when not explicitly set in the manifest.