summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* 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
* | 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
* | Merge "Support smart-sync through persistent-http[s]"Dan Willemsen2015-08-193-38/+145
|\ \
| * | Support smart-sync through persistent-http[s]Dan Willemsen2015-08-193-38/+145
| |/ | | | | | | | | | | | | Use the same cookies and proxy that git traffic goes through for persistent-http[s] to support authentication for smart-sync. Change-Id: I20f4a281c259053a5a4fdbc48b1bca48e781c692
* | Merge "Fix formatting of message when retrying clone"Dan Willemsen2015-08-191-1/+1
|\ \
| * | Fix formatting of message when retrying cloneDavid Pursehouse2015-08-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Passing the force_sync variable into the string formatting results in the message: "Retrying clone after deleting None" or "Retrying clone after deleting True". Pass the name of the git directory instead. Also, move the print inside the if-block so it's only displayed when the retry is actually going to be attempted. Change-Id: I76d9ecc176cecee4ad512d13e9d1f6bd36aacbbb
* | | Merge "Include project path in --force-sync error message"Dan Willemsen2015-08-191-1/+4
|\ \ \
| * | | Include project path in --force-sync error messageSimon Ruggier2015-08-041-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For projects that have been cloned outside of the repo command (or cloned a long time ago), commit abaa7f312f1b6c8d11d7c757fe909900ce5788b5 introduced an error message to invite the user to use --force-sync. However, due to the risk of data loss, it's useful to know which project's git directory is being replaced before deciding whether or not to provide --force-sync. This change updates the exception's associated value to include the project's relative path and explain to the user how they can resolve the issue. A previous version of this commit used the project name. However, for projects that have multiple work trees, the name can be ambiguous, while the path clearly identifies which git directory will be replaced. Change-Id: If717e66fda4d19accc0a8e889a91f4cd4ff14dff
* | | | Merge "Copy clone-depth in `repo manifest`"Dan Willemsen2015-08-191-0/+3
|\ \ \ \ | |_|/ / |/| | |
| * | | Copy clone-depth in `repo manifest`Dan Willemsen2015-08-171-0/+3
| | |/ | |/| | | | | | | | | | | | | | | | This argument wasn't being copied, which caused syncs from generated manifests to pull down too much of the git history. Change-Id: I269bab788d4557267c081628b3f8c6aec7744e81
* / | GITC: Add repo sync support.Simran Basi2015-08-183-53/+108
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Merge "GITC: Add gitc-init subcommand to repo."Dan Willemsen2015-08-122-3/+147
|\ \
| * | GITC: Add gitc-init subcommand to repo.Simran Basi2015-08-122-3/+147
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | Merge "Fix shallow clone behavior"Dan Willemsen2015-08-051-10/+7
|\ \ \
| * | | Fix shallow clone behaviorDan Willemsen2015-08-031-10/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The existing code here makes sure that switching clone-depth from on to off actually causes the history to be fully restored. Unfortunately, it does this by fetching the full history every time the fetch spec changes. Switching between two clone-depth="1" branches will fetch far more than the top commit. Instead, when not using clone-depth, pass --depth=2147483647 to git fetch so that it ensures that we have the entire history. That is slightly less efficient, so limit it to only when there are shallow objects in the project by checking for the existance of the 'shallow' file. Change-Id: Iee0cfc9c6992c208344b1d9123769992412db67b
* | | | Merge "Support filtering by group on forall and list subcmd"David Pursehouse2015-08-053-4/+11
|\ \ \ \ | |_|_|/ |/| | |
| * | | Support filtering by group on forall and list subcmdGraham Christensen2015-07-303-4/+11
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Enable operating against groups of repositories. As it stands, it isn't compatible with `-r/--regex`. `repo forall -g groupname -c pwd` will run `pwd` for all projects in groupname. `repo forall -g thisgroup,-butnotthisone -c pwd` will run `pwd` for all projects in `thisgroup` but not `butnotthisone`. `repo list -g groupname -n` will list all the names of repos in `groupname`. Change-Id: Ia75c50ce52541d1c8cea2874b20a4db2e0e54960
* | | Include dest-branch attribute in the 'manifest' subcommand's outputSimon Ruggier2015-07-311-0/+6
| |/ |/| | | | | Change-Id: If4227d02005fddea82d9e698a373222100d8f710
* | Merge "Fix _ReferenceGitDir symlinking"v1.12.26Dan Willemsen2015-07-311-1/+2
|\ \
| * | Fix _ReferenceGitDir symlinkingDan Willemsen2015-07-301-1/+2
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes these errors: ... File ".repo/repo/project.py", line 2371, in _ReferenceGitDir os.symlink(os.path.relpath(src, os.path.dirname(dst)), dst) OSError: [Errno 17] File exists Which was happening for checkouts that were created before v1.12.8, when project-objects was created. Nothing had yet been forcing these checkouts to use project-objects, until the recent verification changes. In this OSError case, we already created the symlink, so src == dst, and the directory did not exist. This caused us to run os.makedirs the os.symlink on the same file. dst really should be the file in gitdir, not the target of that symlink if it exists. So just use realpath for the dotgit portion of the path. Change-Id: Iff5396a2093de91029c42cf38aa57131fd22981c
* | Merge "Emit project info in case of sync exception."Conley Owens2015-07-311-1/+3
|\ \ | |/ |/|
| * Emit project info in case of sync exception.Dan Sandler2015-07-311-1/+3
| | | | | | | | | | | | | | | | Previously repo would only print the failing project path if Sync_NetworkHalf returned false/empty, but if it threw an exception the print() was never called. Change-Id: I58c41de43930df5e34b21561c205e062a72e290f