summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Merge changes from topic 'pylint-pep8-cleanup'David Pursehouse2016-03-152-122/+165
|\ | | | | | | | | | | * changes: command.py: Cleaned up pylint/pep8 violations project.py: Cleaned up pylint/pep8 violations
| * command.py: Cleaned up pylint/pep8 violationsMark E. Hamilton2016-03-021-12/+16
| | | | | | | | | | | | | | | | | | | | | | I noticed when running pylint (as the SUBMITTING_PATCHES file directs) that there were a few violations reported. This makes it difficult to see violations I might have introduced. This commit corrects all pylint violations in the command.py script. This script now has a pylint score of 10.0. Change-Id: Ibb35fa9af0e0b9b40e02ae043682b3af23286748
| * project.py: Cleaned up pylint/pep8 violationsMark E. Hamilton2016-03-021-110/+149
| | | | | | | | | | | | | | | | | | | | | | | | I noticed when running pylint (as the SUBMITTING_PATCHES file directs) that there were a number of violations reported. This makes it difficult to see violations I might have introduced. This commit corrects all pylint violations in the project.py script. This script now has a pylint score of 10.0, and no violations reported by pep8. Change-Id: I1462fd84f5b6b4c0dc893052671373e7ffd838f1
* | Update commit-msg hook to version from Gerrit 2.12.1Mike Bjorge2016-03-141-4/+15
| | | | | | | | Change-Id: I31b74aba998f8e83f370a759218777f2557a8872
* | RepoHook: set __file__ when running the hookMike Frysinger2016-03-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A common design pattern is to use __file__ to find the location of the active python module to assist in output or loading of related assets. The current hook systems runs the pre-upload.py hook in a context w/out that set leading to runtime errors: $ repo upload --cbr . ERROR: Traceback (most recent call last): File ".../repo/project.py", line 481, in _ExecuteHook self._script_fullpath, 'exec'), context) File ".../repohooks/pre-upload.py", line 32, in <module> path = os.path.dirname(os.path.realpath(__file__)) NameError: name '__file__' is not defined Define this variable in this context so code can safely use it. Change-Id: If6331312445fa61d9351b59f83abcc1c99ae6748
* | Add rpc: to default protocol whitelistv1.12.33Jonathan Nieder2016-02-261-1/+1
|/ | | | Change-Id: I57e1c3d93c0ce56da9c487df65eb3d258e0260e8
* Better error display on forallAlexandre Garnier2016-02-181-2/+4
| | | | | | | It was only displaying 'Project list error: GitError()' without any useful info about the project nor the error Change-Id: Iad66cbaa03cad1053b5ae9ecc90d7772aa42ac13
* SUBMITTING_PATCHES: Expand instructionsMark E. Hamilton2016-02-171-1/+29
| | | | | | | This commit adds additional instructions on getting patches submitted, based on my recent experience doing so. Change-Id: I8e0d37d316214cc9a39383414773aad181f83f18
* repo: Cleaned up pylint/pep8 violationsMark E. Hamilton2016-02-151-42/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I noticed when running pylint (as the SUBMITTING_PATCHES file directs) that there were a number of violations reported. This makes it difficult to see violations I might have introduced. This commit corrects all pylint violations in the repo script. First I ran this to clean up the formatting: autopep8 --max-line-length=80 --indent-size 2 repo Following that the following violations remained: % pylint --rcfile=.pylintrc repo ************* Module repo W:220,21: Redefining name 'init_optparse' from outer scope (line 156) (redefined-outer-name) W:482, 2: No exception type(s) specified (bare-except) C:704, 0: Old-style class defined. (old-style-class) For line 220, the parameter to _GitcInitOptions was renamed so as not to mask the init_optparse global. For line 482, a pylint directive was added to disable the bare-execpt violation for just that line. For line 704, the _Options class was changed to subclass object. Additionally, the comments at lines 107-113 were spaced out to line up with the comment at line 112 that autopep8 moved. This script now has a pylint score of 10.0 Change-Id: I779b66eb6b061a195d3c4372b99dec1b6d2a214f
* repo: Add check of REPO_URL env variableMark E. Hamilton2016-02-091-2/+4
| | | | | | | | | | | | | | We want to be able to run repo on a system that is not connected to the Internet and cannot access https://gerrit.googlesource.com. We can put a clone of that repos there, but would prefer to use the stable version of the repo script instead of a locally modified version. This commit adds a check for the REPO_URL environment variable. If that is set and not empty its value will be set in the REPO_URL global in repo. Otherwise the standard path will be used. Change-Id: I0616f5f81ef75f3463b73623b892cb5eed6bb7ba
* Merge "Fix typos for manifest dtd"Dan Willemsen2016-02-041-8/+8
|\
| * Fix typos for manifest dtdKenny Ho2015-12-111-8/+8
| | | | | | | | Change-Id: If53721544eca570e2bcce4598cdc2670a679c681
* | Merge "Fix prune when bare git has detached head"Dan Willemsen2016-02-041-3/+4
|\ \
| * | Fix prune when bare git has detached headDan Willemsen2015-12-151-3/+4
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We don't really use HEAD much in the bare git repositories, but there have been reports of errors in git-symbolic-ref: symbolic-ref: fatal: Refusing to point HEAD outside of refs/ That happen when the bare git repo is in the detached head state. It's possible that previous operations were killed while we were pruning branches. Use DetachHead instead of SetHead if we're restoring the repo into a detached head state. Change-Id: I9062e8957bc70367d3ded399685ac026fbb421fc
* | Merge "GITC: Fix 'repo start <branch> <repo>/<subdir>'"Dan Willemsen2016-02-041-5/+12
|\ \
| * | GITC: Fix 'repo start <branch> <repo>/<subdir>'Dan Willemsen2016-02-041-5/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As soon as we wrote the gitc manifest, the folder for that repo became empty, causing the next GetProjects lookup to fail. Reorder the GetProjects calls so that they all happen while we still have the repository contents available. If you were already in a subdir, for cases like 'repo start <branch> .', this would still fail, since the working directory would disappear out from under you. That's fine most of the time, since we shouldn't be doing operations based on the local directory, but git has a realpath function that tries to restore CWD by chdir'ing back to it. So if the working directory no longer exists, chdir to the topdir before continuing. Change-Id: Ibdf6cd37ff6e5a5f8338347c3919175491f7166f
* | | Add option to rebase onto project's manifest versionXiaohui Chen2016-01-281-0/+9
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | Some teams have a continuous build server that would mark certain manifest green and safe to sync to. Then team members could repo sync to that particular manifest file and make sure they always sync to a green build. But if she/he has some local changes and wants to rebase, currently it would be a manual process to find the correct version to rebase onto. This patch helps with that use case by automating the process to rebase onto the currently synced manifest version. Change-Id: I847c9eb6addf7f84fd3f5594fbf8c0bcc103f9a5
* | Sync: Fix error exit code when both -n and -f are usedHu Xiuyun2015-11-261-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | When repo sync is used with -f (--force-error) and a project fails to sync, the sync will continue but then exit with an error status. However if -n (--network-only) is also used, the exit code is 0, even when a project failed. Modify the logic to make sure the sync exits with the correct status. Bug: Issue 214 Change-Id: I0b5d97a34642c5aa3743750ef14a42c9d5743c1d
* | Set GIT_ALLOW_PROTOCOL to limit dangerous protocolsDan Willemsen2015-11-261-0/+3
| | | | | | | | | | | | | | | | | | See git commit 33cfccbbf35a -- some protocols allow arbitrary command execution as part of the URL. Instead of blindly allowing those, whitelist the allowed URL protocols unless the user has already done so. Bug: Issue 210 Change-Id: I6bd8e721aa5e3dab53ef28cfdc8fde33eb74ef76
* | Check for broken links when updating linkfilesDan Willemsen2015-11-181-1/+1
| | | | | | | | | | | | | | | | If a linkfile is a broken link (destination does not exist), and it needs to be updated, we didn't notice that it needed to be removed first. Use lexists instead of exists to check for this condition. Change-Id: I1f6a1f0193d3fd2b9f7a647836044997f6ab32eb
* | Sync: Add option to prune refs during syncDavid Pursehouse2015-10-272-4/+15
| | | | | | | | | | | | | | | | By passing --prune to the sync command, the --prune option is given to the `git fetch`, causing refs that no longer exist on the remote to be removed. Change-Id: I3cedacce14276d96ac2d5aabf2d07fd05e92bc02
* | A couple of fixes to the init command's -p option.Pascal Muetschard2015-10-221-2/+2
|/ | | | | | | | | Adds windows as one of the allowed platforms flags. Fixes -p foo to append 'platform-foo', instead of each letter (list.extend expects a list and thus appends each char in the string, rather than the string itself). Change-Id: I73a92127ac29a32fc31b335cc54a246302904140
* Fix gitc-init behaviorv1.12.32Dan Willemsen2015-10-075-25/+119
| | | | | | | | | | | | With gitc-init, a gitc client may be specified using '-c'. If we're not currently in that client, we need to change directories so that we don't affect the local checkout, and to ensure that repo is checked out in the new client. This also makes '-c' optional if already in a gitc client, to match the rest of the init options. Change-Id: Ib514ad9fd101698060ae89bb035499800897e9bd
* Sync: Add HTTP Cookie File header on temporary cookie fileDavid Pursehouse2015-10-021-0/+1
| | | | | | | | | | | | | | | | | | | | The .gitcookies file generated by googlesource.com does not have the header: # (Netscape) HTTP Cookie File which causes python's MozillaCookieJar.load to fail with the error: "does not look like a Netscape format cookies file" Prepend the expected header onto the generated cookie file. We don't bother to check if the header already exists on the file; repeating it does not cause any problem. Bug: Issue 207 Change-Id: I7d39720a1d36a6aae00f70691156514ebc04e579
* Sync: Don't fail when git cookies can't be loadedDavid Pursehouse2015-10-021-1/+4
| | | | | | | | If the git cookies file fails to load, use a default cookie jar instead. Bug: Issue 207 Change-Id: I7cb326c204f2784ab4dbd13801b3186667af5b78
* GITC: Add repo gitc-delete command.Simran Basi2015-10-011-0/+55
| | | | | | | | repo gitc-delete deletes a GITC client and all the locally saved sources. Useful for removing unnecessary clients and recovering disk space. Change-Id: Idf23addcea52b8713d268c34a7b37da0c5e5cd26
* Add GitcClientCommand class for GITC-specific commandsDan Willemsen2015-09-294-7/+21
| | | | | | | These won't show up as common commands in the help text unless in a GITC client, and will refuse to execute. Change-Id: Iffe82adcc9d6ddde9cb4b204f83ff018042bdab0
* Merge "launcher: Update repo after applying clone.bundle"Dan Willemsen2015-09-141-3/+2
|\
| * launcher: Update repo after applying clone.bundleDan Willemsen2015-09-021-3/+2
| | | | | | | | | | | | | | | | | | | | | | If the clone.bundle is out of date, repo may be installed with an old version. It will upgrade with the next sync a day later, or when "repo selfupdate" is run. This behavior was added to normal project downloads, but was never added to the repo launcher. Change-Id: Ib04bef3a658c98fe1b6c53b3e8d0067165a5e3f7
* | Merge "docs: add copyfile and linkfile elements description"David Pursehouse2015-09-141-1/+26
|\ \
| * | docs: add copyfile and linkfile elements descriptionRuslan Bilovol2015-09-101-1/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The "copyfile" element is available since 2009 and have been used in every Android manifest; the "linkfile" element is available since 2014. Now it's a good time to add both to the documentation Change-Id: Ia987edf5f69a006235fbd3f33b744e9794a6d964 Signed-off-by: Ruslan Bilovol <ruslan.bilovol@gmail.com>
* | | fixed typo in gitc_init.py help outputAlexander Bird2015-09-111-1/+1
| | | | | | | | | | | | Change-Id: I86459bf63297487457d6c4c995dfd1e63133ec53
* | | GITC: Always update the gitc manifest from the repo manifestv1.12.31Dan Willemsen2015-09-095-36/+104
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This way any changes made to the main manifest are reflected in the gitc manifest. It's also necessary to use both manifests to sync since the information required to update the gitc manifest is actually in the repo manifest. This also fixes a few issues that came up when testing. notdefault groups weren't being saved to the gitc manifest in a method that matched 'sync'. The merge branch wasn't always being set to the correct value either. Change-Id: I435235cb5622a048ffad0059affd32ecf71f1f5b
* | | Merge "Revert "GITC: Always update the gitc manifest from the repo manifest""v1.12.30.1Dan Willemsen2015-09-095-100/+34
|\ \ \
| * | | Revert "GITC: Always update the gitc manifest from the repo manifest"Dan Willemsen2015-09-095-100/+34
| | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 250303b437855c2b50d052a05a08ed517423af8b. Change-Id: I1fd8af20f802553151aacb953c913f3305ca6057
* | | | Merge "_CopyAndLinkFiles even if the sources haven't changed"v1.12.30Dan Willemsen2015-09-091-0/+4
|\ \ \ \ | |/ / / |/| | |
| * | | _CopyAndLinkFiles even if the sources haven't changedDan Willemsen2015-09-031-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The source or destination attributes may have changed even if the source didn't, so we need to make sure that these are up to date. Change-Id: I266ef3598ddda7e8c23bc9c6a049905ddc586348
* | | | GITC: Always update the gitc manifest from the repo manifestDan Willemsen2015-09-095-34/+100
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This way any changes made to the main manifest are reflected in the gitc manifest. It's also necessary to use both manifests to sync since the information required to update the gitc manifest is actually in the repo manifest. This also fixes a few issues that came up when testing. notdefault groups weren't being saved to the gitc manifest in a method that matched 'sync'. The merge branch wasn't always being set to the correct value either. Change-Id: I5dbc850dd73a9fbd10ab2470ae4c40e46ff894de
* | / GITC: Fix repo sync.v1.12.29Simran Basi2015-09-031-1/+1
| |/ |/| | | | | | | | | | | Fixing http://b/23785024 by calling os.getcwd() because variable cwd no longer exists. Change-Id: I21ff7d059e072f9f60726db76b67587a92c878ad
* | gitc: Improve help visibilityv1.12.28Dan Willemsen2015-09-015-5/+39
| | | | | | | | | | | | | | This improves the visiblity of gitc-init if we can get the gitc config, and hides it otherwise. Change-Id: I82830b0b07c311e8c74397ba79eb4c361f8b6fb5
* | Fix gitc check if gitc isn't installedDan Willemsen2015-08-311-2/+3
| | | | | | | | | | | | This was doing cwd.startswith(''), which is always true. Change-Id: Icc059c09492b31e2d7651e4a595bda783c5abc47
* | GITC: Pull GITC Manifest Dir from the config.Simran Basi2015-08-315-21/+35
| | | | | | | | | | | | | | Updates the repo launcher and gitc_utils to pull the manifest directory location out of the gitc config file. Change-Id: Id08381b8a7d61962093d5cddcb3ff6afbb13004b
* | GITC: Expand relative remote URLs.Simran Basi2015-08-281-2/+4
| | | | | | | | | | | | | | | | The GITC filesystem does not understand relative URLs for remotes, so now if a remote uses a relative URL, it will be be expanded to be relative to the manifest URL. Change-Id: Ie1210758560aeb1934da3f71496aaf19c2728214
* | GITC: Add repo start support.Simran Basi2015-08-287-39/+166
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add repo start support for GITC checkouts. If the user is in the GITC FS view, they can now run repo start to check out the sources and create a new working branch. When "repo start" is called on a GITC project, the revision tag is set to an empty string and saved in a new tag: old-revision. This tells the GITC filesystem to display the local copy of the sources when being viewed. The local copy is created by pulling the project sources and the new branch is created based off the original project revision. Updated main.py to setup each command's gitc_manifest when appropriate. Updated repo sync's logic to sync opened projects and updating the GITC manifest file for the rest. Change-Id: I7e4809d1c4fc43c69b26f2f1bebe45aab0cae628
* | project.py: Improve message shown when hook is not replacedDavid Pursehouse2015-08-251-1/+1
| | | | | | | | | | | | | | | | | | | | If a hook file has been modified locally, it will not be replaced. Improve the message to make this clearer. Also change it from an error to a warning. Change-Id: I62c635390f24d2868db17717c247861b0381c99f
* | project.py: Consistently use the _error method to print error messagesDavid Pursehouse2015-08-251-7/+8
| | | | | | | | | | | | | | | | Use the _error method instead of directly calling `print`. Also add a new _warn convenience method. Change-Id: Ia332c14ef8d9d1fe2df128dbf36b5521802ccdf1
* | Smartsync: Don't fail if there isn't a cookiefilev1.12.27Dan Willemsen2015-08-201-13/+16
| | | | | | | | Change-Id: I434a259f43ca9808e88051ac8ba865c519a24702
* | Sync: Refactor netrc parsingDavid Pursehouse2015-08-201-10/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | Don't emit a message when the netrc file doesn't exist or couldn't be opened. Instead of trying to unpack the result of info.authenticators() and catching the resulting TypeError when it's None, first store it to a local and only unpack it if it has a value. Also remove an unused import. Change-Id: I5c404d91e48c261c1ab850c3e5f040c4f4c235cb
* | gitc_init: Remove unused importDavid Pursehouse2015-08-201-2/+1
| | | | | | | | | | | | Also add missing newline at the end of the file. Change-Id: I206e6c4b033d223eb0ff5824ecbf6fd98c39c918
* | gitc_utils: Fix incorrect string format argumentDavid Pursehouse2015-08-201-1/+1
| | | | | | | | Change-Id: Ibbac6e111833c8f5d93cb6cb4a10f8f2c4fd8e11