summaryrefslogtreecommitdiffstats
path: root/subcmds/gitc_init.py
Commit message (Collapse)AuthorAgeFilesLines
* Format codebase with black and check formatting in CQGavin Mak2023-03-221-29/+40
| | | | | | | | | | | | Apply rules set by https://gerrit-review.googlesource.com/c/git-repo/+/362954/ across the codebase and fix any lingering errors caught by flake8. Also check black formatting in run_tests (and CQ). Bug: b/267675342 Change-Id: I972d77649dac351150dcfeb1cd1ad0ea2efc1956 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/363474 Reviewed-by: Mike Frysinger <vapier@google.com> Tested-by: Gavin Mak <gavinmak@google.com> Commit-Queue: Gavin Mak <gavinmak@google.com>
* GitcInit: fix gitc-init failurev2.29.6Woody Lin2022-11-041-1/+2
| | | | | | | | | | | | Aligns argument usage of refactored GitcManifest (8c1e9cbef "manifest_xml: refactor manifest parsing from client management") to fix the `repo gitc-init` error: `fatal: manifest_file must be abspath`. Change-Id: I1728032cce3f39ed1077bbb7ef714410c2c49e1a Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/350374 Tested-by: Woody Lin <woodylin@google.com> Reviewed-by: LaMont Jones <lamontjones@google.com> Reviewed-by: Xin Li <delphij@google.com>
* Add multi-manifest support with <submanifest> elementv2.22LaMont Jones2022-02-171-0/+1
| | | | | | | | | | | To be addressed in another change: - a partial `repo sync` (with a list of projects/paths to sync) requires `--this-tree-only`. Change-Id: I6c7400bf001540e9d7694fa70934f8f204cb5f57 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/322657 Tested-by: LaMont Jones <lamontjones@google.com> Reviewed-by: Mike Frysinger <vapier@google.com>
* commands: document the "common" class attributeMike Frysinger2021-06-151-1/+1
| | | | | | | | | | Switch it to uppercase to make it clear it's a constant, and add documentation so its usage is clear. Change-Id: I6d281a66a90b5908b3131585c9945e88cfe815ea Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/309322 Reviewed-by: Raman Tenneti <rtenneti@google.com> Tested-by: Mike Frysinger <vapier@google.com>
* init: merge subcmd & wrapper parsersMike Frysinger2021-04-091-7/+0
| | | | | | | | | | These are manually kept in sync which is a pain. Have the init subcmd reuse the wrapper code directly. Change-Id: Ica73211422c64377bacc9bb3b1d1a8d9d5f7f4ca Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/302762 Reviewed-by: Raman Tenneti <rtenneti@google.com> Tested-by: Mike Frysinger <vapier@google.com>
* use simpler super() magicMike Frysinger2021-02-191-2/+2
| | | | | | | | | | Python 3 has a simpler super() style so switch to it to make the code a little simpler and to stop pylint warnings. Change-Id: I1b3ccf57ae968d56a9a0bcfc1258fbd8bfa3afee Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/297383 Reviewed-by: Michael Mortensen <mmortensen@google.com> Tested-by: Mike Frysinger <vapier@google.com>
* strip python2-only coding:utf-8 & print_function settingsMike Frysinger2021-01-061-3/+0
| | | | | | | | | | We're committed to Python 3 at this point, so clean up boilerplate. Bug: https://crbug.com/gerrit/10418 Change-Id: Ib1719ba2eb65c53b94881a1a1bf203ddfcaaafed Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/292382 Reviewed-by: Chris Mcdonald <cjmcdonald@google.com> Tested-by: Mike Frysinger <vapier@google.com>
* pyflakes: Fix remaining "E501 line too long" warningsDavid Pursehouse2020-02-131-1/+2
| | | | | | | | | | | We increased the max line length to 100 columns which got rid of the majority of these warnings, but there were still a few lines that exceeded 100 columns. Change-Id: Ib3372868ca2297f83073a14f91c8ae3df9d0d0e6 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/254699 Tested-by: David Pursehouse <dpursehouse@collab.net> Reviewed-by: Mike Frysinger <vapier@google.com>
* init: handle -c conflicts with gitc-initMike Frysinger2020-02-051-1/+1
| | | | | | | | | | | | We keep getting requests for init to support -c. This conflicts with gitc-init which allocates -c for its own use. Lets make this dynamic so we keep it with "init" but omit it for "gitc-init". Bug: https://crbug.com/gerrit/10200 Change-Id: Ibf69c2bbeff638e28e63cb08926fea0c622258db Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/253252 Reviewed-by: David Pursehouse <dpursehouse@collab.net> Tested-by: Mike Frysinger <vapier@google.com>
* 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
* Fix gitc-init behaviorv1.12.32Dan Willemsen2015-10-071-10/+8
| | | | | | | | | | | | 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
* Add GitcClientCommand class for GITC-specific commandsDan Willemsen2015-09-291-2/+2
| | | | | | | 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
* 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-091-5/+7
| | | | | | | | | | | | | | 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-3/+5
| | | | | | This reverts commit 250303b437855c2b50d052a05a08ed517423af8b. Change-Id: I1fd8af20f802553151aacb953c913f3305ca6057
* GITC: Always update the gitc manifest from the repo manifestDan Willemsen2015-09-091-5/+3
| | | | | | | | | | | | | | 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: Improve help visibilityv1.12.28Dan Willemsen2015-09-011-1/+2
| | | | | | | This improves the visiblity of gitc-init if we can get the gitc config, and hides it otherwise. Change-Id: I82830b0b07c311e8c74397ba79eb4c361f8b6fb5
* GITC: Pull GITC Manifest Dir from the config.Simran Basi2015-08-311-3/+3
| | | | | | | 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_init: Remove unused importDavid Pursehouse2015-08-201-2/+1
| | | | | | Also add missing newline at the end of the file. Change-Id: I206e6c4b033d223eb0ff5824ecbf6fd98c39c918
* GITC: Add repo sync support.Simran Basi2015-08-181-53/+10
| | | | | | | | | | | | | | 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
* GITC: Add gitc-init subcommand to repo.Simran Basi2015-08-121-0/+123
Adds the new gitc-init command to set up a GITC client. Gitc-init sets up the client directory and calls repo init within it. Once the repo is initialized, then generates a GITC manifest file by using git ls-remote on each project and retrieving the HEAD SHA to use as the revision attribute. Gitc-init inherits from and has all the options as repo init. Change-Id: Icd7e47e90eab752a77de7c80ebc98cfe16bf6de3