summaryrefslogtreecommitdiffstats
path: root/gitc_utils.py
Commit message (Collapse)AuthorAgeFilesLines
* set default file encoding to utf-8Mike Frysinger2019-06-131-0/+1
| | | | | | | | There's no reason to support any other encoding in these files. This only affects the files themselves and not streams they open. Bug: https://crbug.com/gerrit/10418 Change-Id: I053cb40cd3666ce5c8a0689b9dd938f24ca765bf
* tweak raise/dict syntax for Python 3 compatMike Frysinger2019-06-131-6/+6
| | | | | | | | | | | | | | | | Use the `raise` statement directly. Switch to using .items() instead of .iteritems(). Python 3 doesn't have .iteritems() as .items() is a generator, and these are small enough that the Python 2 overhead should be negligible. We have to run .keys() through list() in a few places as Python 3 uses a generator and we sometimes want to iterate more than once. That's why we don't change all .keys() or .items() calls -- most are in places where generators are fine. Bug: https://crbug.com/gerrit/10418 Change-Id: I469899d9b77ffd77ccabb831bc4b217407fefe6f
* gitc: Lower concurrent ls-projects requestsv1.12.34Dan Willemsen2016-08-231-1/+1
| | | | | | Too many requests at the same time is causing 502 errors. Change-Id: Ic8fbb2fbb7fb6014733fa5be018d2dc02472f704
* Bail out when manifest is referencing a bad SHA-1 revision.Xin Li2016-06-291-1/+7
| | | | | BUG: Issue 222 Change-Id: Ie0a64b39922d6fdf1be2989eb514985be8490278
* pylint: Fix unused-{argument,variable} warningStefan Beller2016-06-211-1/+1
| | | | | | | | | | | | | | | | This commit fixes 4 out of the remaining 5 pylint warnings: $ pylint --rcfile=.pylintrc *.py ************* Module gitc_utils W:146, 0: TODO(sbasi/jorg): Come up with a solution to remove the sleep below. (fixme) W:130, 6: Unused variable 'name' (unused-variable) ************* Module main W:382,32: Unused argument 'fp' (unused-argument) W:382,36: Unused argument 'code' (unused-argument) W:382,42: Unused argument 'msg' (unused-argument) Change-Id: Ie3d77b9a65b7daefaa9aa4b80f4b682c1678fd58 Signed-off-by: Stefan Beller <sbeller@google.com>
* Fix gitc-init behaviorv1.12.32Dan Willemsen2015-10-071-11/+1
| | | | | | | | | | | | 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
* GITC: Always update the gitc manifest from the repo manifestv1.12.31Dan Willemsen2015-09-091-12/+69
| | | | | | | | | | | | | | 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
* Revert "GITC: Always update the gitc manifest from the repo manifest"Dan Willemsen2015-09-091-74/+11
| | | | | | This reverts commit 250303b437855c2b50d052a05a08ed517423af8b. Change-Id: I1fd8af20f802553151aacb953c913f3305ca6057
* GITC: Always update the gitc manifest from the repo manifestDan Willemsen2015-09-091-11/+74
| | | | | | | | | | | | | | 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: Pull GITC Manifest Dir from the config.Simran Basi2015-08-311-2/+4
| | | | | | | Updates the repo launcher and gitc_utils to pull the manifest directory location out of the gitc config file. Change-Id: Id08381b8a7d61962093d5cddcb3ff6afbb13004b
* GITC: Add repo start support.Simran Basi2015-08-281-3/+34
| | | | | | | | | | | | | | | | | | | | | 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
* gitc_utils: Fix incorrect string format argumentDavid Pursehouse2015-08-201-1/+1
| | | | Change-Id: Ibbac6e111833c8f5d93cb6cb4a10f8f2c4fd8e11
* gitc_utils: Remove unused variableDavid Pursehouse2015-08-201-1/+0
| | | | Change-Id: I569819675a99ff6c01fb57b23fed033c39d14d1f
* gitc_utils: Remove unused import; add missing importDavid Pursehouse2015-08-201-1/+1
| | | | | | | | shutils is not used. Remove it. sys is used, but not imported. Import it. Change-Id: I4ee582f33bbd451601097ef2f20bee23b54764cd
* GITC: Add repo sync support.Simran Basi2015-08-181-0/+69
Add repo sync support for GITC checkouts. If the user is in the GITC client directory they can still pull the sources as normal if they pass in the --force-gitc argument. Otherwise the user should call repo sync in the GITC view to update the user's remote view. (This works because .repo in the GITC view will link to .repo in the client config directory.) Part of the support for this change is the refactoring of GITC related code into gitc_utils.py. Change-Id: I2636aaa50b450b6f091309db8dd0e8f4dbdad579