summaryrefslogtreecommitdiffstats
path: root/manifest_xml.py
Commit message (Collapse)AuthorAgeFilesLines
* manifest: drop support for local_manifest.xmlMike Frysinger2020-09-081-10/+6
| | | | | | | | | | We deprecated this 8 years ago. Time to drop it to simplify the code as it'll help with refactoring in this module to not migrate it. Change-Id: I2deae5496d1f66a4491408fcdc95cd527062f8b6 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/280798 Tested-by: Mike Frysinger <vapier@google.com> Reviewed-by: Michael Mortensen <mmortensen@google.com>
* manifest: normalize name & path when constructing fs pathsMike Frysinger2020-05-261-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the manifest uses a trailing slash on the name attribute, repo will construct bad internal filesystem paths which confuses tools later on. For example, this manifest entry: <project name="aosp/platform/system/libhidl/" ... will cause repo to use paths like: .repo/project-objects/aosp/platform/system/libhidl/.git/ when it really should be using: .repo/project-objects/aosp/platform/system/libhidl.git Apply the normalization when we construct the local filesystem paths as we cannot guarantee that the remote URL constructed from these will behave the same. A server might really want: https://example.com/aosp/platform/system/libhidl/ and would throw an error if we instead tried to fetch: https://example.com/aosp/platform/system/libhidl Unfortunately, any existing repo client checkouts that use such a manifest will hit a one-time sync error as the internal git location has changed. I'm not sure there's a way to cleanly migrate that. Bug: https://crbug.com/1086043 Change-Id: I30bea0ffd23e478de89a035f408055e48a102658 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/268742 Tested-by: Mike Frysinger <vapier@google.com> Reviewed-by: David Pursehouse <dpursehouse@digital.ai>
* Make partial clone imply no-clone-bundle by default.Xin Li2020-05-211-0/+8
| | | | | | | | | | | | | | | | | | For large projects, clone bundle is useful because it provided a way to efficiently transfer a large portion of git objects through CDN, without needing to interact with git server. However, with partial clones, the intention is to not download most of the objects, so the use of clone bundles would defeat the space savings normally seen with partial clones, as they are downloaded before the first fetch. A new option, --clone-bundle is added to override this behavior. Add a new repo.clonebundle variable which remembers the choice if explicitly given from command line at repo init. Change-Id: I03638474af303a82af34579e16cd4700690b5f43 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/268452 Tested-by: Xin Li <delphij@google.com> Reviewed-by: Jonathan Nieder <jrn@google.com>
* When writing manifest, set the dest-branch attribute for projectsSean McAllister2020-04-201-1/+8
| | | | | | | | | | | | | | When generating a revision locked manifest, we need to know what ref to push changes to when doing 'repo upload'. This information is lost when we lock the revision attribute to a particular commit hash, so we need to expose it through the dest-branch attribute. Bug: https://crbug.com/1005103 Test: manual execution Change-Id: Ib31fd77ad8c9379759c4181dac1ea97de43eec35 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/263572 Tested-by: Sean McAllister <smcallis@google.com> Reviewed-by: Mike Frysinger <vapier@google.com>
* manifest_xml: unify bool & int parsingMike Frysinger2020-03-131-55/+70
| | | | | | | | | | | | | | | | | We've been overly lenient with boolean parsing by ignoring invalid values as "false" even if the user didn't intend that. Turn all unknown values into warnings to avoid breaking existing manifests, and unify the parsing logic in a helper to simplify. We've been stricter about numbers, but still copying & pasting inconsistent code. Add a helper for this too. For out of range sync-j numbers (i.e. less than 1), throw a warning for now, but mark it for future hard failures. Change-Id: I924162b8036e6a5f1e31b6ebb24b6a26ed63712d Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/256457 Reviewed-by: Michael Mortensen <mmortensen@google.com> Tested-by: Mike Frysinger <vapier@google.com>
* manifest_xml: skip config lookup during first initv2.4.1Mike Frysinger2020-02-241-1/+1
| | | | | | | | | | | | | | | Trying to use the config state when the git tree hasn't yet been created hits bad side effects. Add a check to avoid probing the config logic during the first run. It's not clear what's going wrong at the lower layers, but this gets us back to the behavior before we added worktree support, so lets settle the status quo. Bug: https://crbug.com/gerrit/12387 Change-Id: I85b56797455f3c2e249d02c18496e060be05501d Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/256592 Reviewed-by: Xin Li <delphij@google.com> Reviewed-by: Mike Frysinger <vapier@google.com> Tested-by: Mike Frysinger <vapier@google.com>
* manifest_xml: change .repo/manifest.xml to a plain fileMike Frysinger2020-02-221-6/+21
| | | | | | | | | | | | | | | | Changing this to a file instead of using a symlink serves two purposes: * We can insert some comments & doc links to help users learn what this is for, discover relevant documentation, and to discourage them from modifying things. * Windows requires Administrator access to use symlinks. With this last change, Windows users can get repo client checkouts with the new --worktree option and not need symlinks anywhere at all. Which means they no longer need to be an Administrator in order to `repo sync`. Change-Id: I9bc46824fd8d4b0f446ba84bd764994ca1e597e2 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/256313 Tested-by: Mike Frysinger <vapier@google.com> Reviewed-by: David Pursehouse <dpursehouse@collab.net>
* manifest/tests: get them passing under WindowsMike Frysinger2020-02-211-3/+14
| | | | | | | | | | | | | | We also need to check more things in the manifest/project handlers, and use platform_utils in a few places to address Windows behavior. Drop Python 2.7 from Windows testing as it definitely doesn't work and we won't be fixing it. Change-Id: I83d00ee9f1612312bb3f7147cb9535fc61268245 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/256113 Tested-by: Mike Frysinger <vapier@google.com> Reviewed-by: Jonathan Nieder <jrn@google.com> Reviewed-by: David Pursehouse <dpursehouse@collab.net>
* add experimental git worktree supportMike Frysinger2020-02-191-6/+29
| | | | | | | | | | | | | | | | | This provides initial support for using git worktrees internally instead of our own ad-hoc symlink tree. It's been lightly tested which is why it's not currently exposed via --help. When people opt-in to worktrees in an existing repo client checkout, no projects are migrated. Instead, only new projects will use the worktree method. This allows for limited testing/opting in without having to completely blow things away or get a second checkout. Bug: https://crbug.com/gerrit/11486 Change-Id: Ic3ff891b30940a6ba497b406b2a387e0a8517ed8 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/254075 Tested-by: Mike Frysinger <vapier@google.com> Reviewed-by: Mike Frysinger <vapier@google.com>
* Fix blank line issues reported by flake8David Pursehouse2020-02-121-1/+3
| | | | | | | | | | | | | | | | | | | | - E301 expected 1 blank line - E302 expected 2 blank lines - E303 too many blank lines - E305 expected 2 blank lines after class or function definition - E306 expected 1 blank line before a nested definition Fixed automatically with autopep8: git ls-files | grep py$ | xargs autopep8 --in-place \ --select E301,E302,E303,E305,E306 Manually fix issues in project.py caused by misuse of block comments. Change-Id: Iee840fcaff48aae504ddac9c3e76d2acd484f6a9 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/254599 Reviewed-by: Mike Frysinger <vapier@google.com> Tested-by: David Pursehouse <dpursehouse@collab.net>
* Fix indentation issues reported by flake8David Pursehouse2020-02-121-13/+13
| | | | | | | | | | | | | | | | | | | | | - E121 continuation line under-indented for hanging indent - E122 continuation line missing indentation or outdented - E125 continuation line with same indent as next logical line - E126 continuation line over-indented for hanging indent - E127 continuation line over-indented for visual indent - E128 continuation line under-indented for visual indent - E129 visually indented line with same indent as next logical line - E131 continuation line unaligned for hanging indent Fixed automatically with autopep8: git ls-files | grep py$ | xargs autopep8 --in-place \ --select E121,E122,E125,E126,E127,E128,E129,E131 Change-Id: Ifd95fb8e6a1a4d6e9de187b5787d64a6326dd249 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/254605 Reviewed-by: Mike Frysinger <vapier@google.com> Tested-by: David Pursehouse <dpursehouse@collab.net>
* Fix various whitespace issues reported by pyflakesDavid Pursehouse2020-02-121-2/+2
| | | | | | | | | | | | | | | | | | | | | | - E201 whitespace after '[' - E202 whitespace before '}' - E221 multiple spaces before operator - E222 multiple spaces after operator - E225 missing whitespace around operator - E226 missing whitespace around arithmetic operator - E231 missing whitespace after ',' - E261 at least two spaces before inline comment - E271 multiple spaces after keyword Fixed automatically with autopep8: git ls-files | grep py$ | xargs autopep8 --in-place \ --select E201,E202,E221,E222,E225,E226,E231,E261,E271 Change-Id: I367113eb8c847eb460532c7c2f8643f33040308c Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/254601 Reviewed-by: Mike Frysinger <vapier@google.com> Tested-by: David Pursehouse <dpursehouse@collab.net>
* Fix tests for membership to use 'not in'David Pursehouse2020-02-121-1/+1
| | | | | | | | | | | flake8 reports: E713 test for membership should be 'not in' Change-Id: I4446be67c431b7267105b53478d2ceba2af758d7 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/254451 Tested-by: David Pursehouse <dpursehouse@collab.net> Reviewed-by: Mike Frysinger <vapier@google.com>
* Fix flake8 E251 unexpected spaces around keyword / parameter equalsDavid Pursehouse2020-02-121-34/+34
| | | | | | | | | | | Fixed automatically with autopep8: git ls-files | grep py$ | xargs autopep8 --in-place --select E251 Change-Id: I58009e1c8c91c39745d559ac919be331d4cd9e77 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/254598 Tested-by: David Pursehouse <dpursehouse@collab.net> Reviewed-by: Mike Frysinger <vapier@google.com>
* Remove trailing blank linesDavid Pursehouse2020-02-121-1/+0
| | | | | | | | | | | flake8 reports: W391 blank line at end of file Change-Id: I5498b2de2d1268d4f1f4b9e1760f9fa93a6da4cd Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/254594 Tested-by: David Pursehouse <dpursehouse@collab.net> Reviewed-by: Mike Frysinger <vapier@google.com>
* manifest_xml: allow src=. with symlinksMike Frysinger2020-02-101-5/+7
| | | | | | | | | | | | | Some Android/Nest manifests are using <linkfile> with src="." to create stable paths to specific projects. Allow that specific use case as it seems reasonable to support. Bug: https://crbug.com/gerrit/11218 Change-Id: I5eadec257cd58ba0f8687c590ddc250a7a414a85 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/254276 Reviewed-by: Michael Mortensen <mmortensen@google.com> Reviewed-by: Mike Frysinger <vapier@google.com> Tested-by: Mike Frysinger <vapier@google.com>
* Add a way to override the remote using <extend-project>Kyunam Jo2020-02-041-0/+5
| | | | | | | | | | | This commit supports for the 'remote' attribute in <extend-project>. This avoids the need to perform a <remove-project> followed by a <project> in local manifests. Change-Id: I9f9347913337ec9d159bc264d15ce97881ae5398 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/253092 Tested-by: Kyunam Jo <kyunam.jo@gmail.com> Reviewed-by: Mike Frysinger <vapier@google.com>
* project: add basic path checks for <copyfile> & <linkfile>Mike Frysinger2020-02-041-2/+2
| | | | | | | | | | | | | | | | | | Reject paths in <copyfile> & <linkfile> that try to use symlinks or non-file or non-dirs. We don't fully validate <linkfile> when src is a glob as it's a bit complicated -- any component in the src could be the glob. We make sure the destination is a directory, and that any paths in that dir are created as symlinks. So while this can be used to read any path, it can't be abused to write to any paths. Bug: https://crbug.com/gerrit/11218 Change-Id: I68b6d789b5ca4e43f569e75e8b293b3e13d3224b Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/233074 Tested-by: Mike Frysinger <vapier@google.com> Reviewed-by: Mike Frysinger <vapier@google.com> Reviewed-by: Michael Mortensen <mmortensen@google.com>
* manifest: add basic path checks for <copyfile> & <linkfile>Mike Frysinger2020-02-041-3/+82
| | | | | | | | | | | | | | Reject paths in <copyfile> & <linkfile> that point outside of their respective scopes. This validates paths while parsing the manifest as this should be quick & cheap: we don't access the filesystem as this code runs before we've synced. Bug: https://crbug.com/gerrit/11218 Change-Id: I8e17bb91f3f5b905a9d76391b29fbab4cb77aa58 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/232932 Tested-by: Mike Frysinger <vapier@google.com> Reviewed-by: Mike Frysinger <vapier@google.com> Reviewed-by: Michael Mortensen <mmortensen@google.com>
* Add support for partial clone.v1.13.4Xin Li2019-07-161-0/+6
| | | | | | | | | | | | | A new option, --partial-clone is added to 'repo init' which tells repo to utilize git's partial clone functionality, which reduces disk and bandwidth usage when downloading by omitting blob downloads initially. Different from restricting clone-depth, the user will have full access to change history, etc., as the objects are downloaded on demand. Change-Id: I60326744875eac16521a007bd7d5481112a98749 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/229532 Reviewed-by: Mike Frysinger <vapier@google.com> Tested-by: Xin Li <delphij@google.com>
* fix raise syntaxMike Frysinger2019-07-051-1/+1
| | | | | | | This takes a single argument (the error message), not multiple arguments that get formatted implicitly. Change-Id: Idfbc913ea9f93820edb7e955e9e4f57618c8cd1b
* 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
* diffmanifests: honor user-supplied manifest pathsBasil Gello2019-06-061-21/+36
| | | | | | | | | | | | | | | | | | | | | | | | | The current implementation ignores the user-specified paths to manifests. if the "repo diffmanifests" is invoked with absolute file paths for one or both manifests, the command fails with message: fatal: duplicate path ... in /tmp/manifest-old.xml Also the current implementation fails to expand the absolute path to manifest files if "repo diffmanifests" is invoked with relative paths, i.e "repo diffmanifests manifest-old.xml manifest-new.xml". fatal: manifest manifest-old.xml not found This commit fixes the first issue by disabling the local manifest discovery for diffmanifests command, and the second issue by expanding paths to manifests within "diffmanifests" sub-command. Test: repo manifest --revision-as-HEAD -o /tmp/manifest-old.xml repo sync repo manifest --revision-as-HEAD -o /tmp/manifest-new.xml repo diffmanifests /tmp/manifest-old.xml /tmp/manifest-new.xml Change-Id: Ia125d769bfbea75adb9aba81abbd8c636f2168d4 Signed-off-by: Vasyl Gello <vasek.gello@gmail.com>
* Add support for long pathsRenaud Paquay2018-10-221-1/+1
| | | | | | | | | | | | | | | | | | | | * Add more file i/o wrappers in platform_utils to allow using long paths (length > MAX_PATH) on Windows. * Paths using the long path syntax ("\\?\" prefix) should never escape the platform_utils API surface area, so that this specific syntax is not visible to the rest of the repo code base. * Forward many calls from os.xxx to platform_utils.xxx in various place to ensure long paths support, specifically when repo decides to delete obsolete directories. * There are more places that need to be converted to support long paths, this commit is an initial effort to unblock a few common use cases. * Also, fix remove function to handle directory symlinks Change-Id: If82ccc408e516e96ff7260be25f8fd2fe3f9571a
* Remove unused pylint suppressionsDavid Pursehouse2018-07-241-2/+1
| | | | | | | | | | | pylint is not used since bb5b1a0. The pyflakes cleanup mentioned in that commit has not been done, but given that this project is no longer being actively developed I don't think it's worth spending time doing it. Leaving the pylint suppressions causes confusion because it leads people to think that we are still using pylint. Change-Id: If7d9f280a0f408c780f15915ffdb80579ae21f69
* manifest: Support a default upstream valueNasser Grainawi2018-05-091-2/+8
| | | | | | | It's convenient to set upstream for all projects in a manifest instead of repeating the same value for each project. Change-Id: I946b1de4efb01b351c332dfad108fa7d4f443cba
* Add a way to override the revision of an <extend-project>Luis Hector Chavez2018-03-151-0/+3
| | | | | | | | This change adds support for the 'revision' attribute in <extend-project>. This avoids the need to perform a <remove-project> followed by a <project> in local manifests. Change-Id: Id2834fcfc1ae0d74b3347bed3618f250bf696b1f
* implement optional 'sync-tags' in the manifest fileYOUNG HO CHA2018-02-141-0/+20
| | | | | | | | Allow the 'default' and 'project' element in the manifest file to apply "--no-tags" option equivalent. Change-Id: I7e0f8c17a0e25cca744d45df049076d203c52ff5 Signed-off-by: YOUNG HO CHA <ganadist@gmail.com>
* Replace all os.remove callsRenaud Paquay2017-08-311-1/+1
| | | | | | | | os.remove raises an exception when deleting read-only files on Windows. Replace all calls with calls to platform_utils.remove, which deals with deals with that issue. Change-Id: I4dc9e0c9a36b4238880520c69f5075eca40f3e66
* Add support for creating symbolic links on WindowsRenaud Paquay2017-05-291-1/+2
| | | | | | | | | | | | Replace all calls to os.symlink with platform_utils.symlink. The Windows implementation calls into the CreateSymbolicLinkW Win32 API, as os.symlink is not supported. Separate the Win32 API definitions into a separate module platform_utils_win32 for clarity. Change-Id: I0714c598664c2df93383734e609d948692c17ec5
* sync: Add support to dump a JSON event log of all sync events.David Riley2017-05-291-2/+4
| | | | Change-Id: Id4852968ac1b2bf0093007cf2e5ca951ddab8b3b
* Use OS file separatorRenaud Paquay2017-05-281-1/+1
| | | | Change-Id: I46b15bc1c1b4f2300a6fd98fe16c755da4910e7a
* init: add --submodules to sync manifest submodulesMartin Kelly2017-05-231-0/+4
| | | | | | | | | | | | | | | | repo sync can sync submodules via the --fetch-submodules option. However, if the manifest repo has submodules, those will not be synced. Having submodules in the manifest repo -- while not commonly done -- can be useful for inheriting a manifest from another project using <include> and layering changes on top of it. In this way, you can avoid having to deal with merge conflicts between your own manifests and the other project's manifests (for example, if you're managing an Android fork). Add a --submodule option to init that automatically syncs the submodules in the manifest repo whenever the manifest repo changes. Change-Id: I45d34f04517774c1462d7f233f482d1d81a332a8 Signed-off-by: Martin Kelly <mkelly@xevo.com>
* Add sso to list of known schemes for relative URLsJoe Kilner2016-10-271-2/+12
| | | | | | | | | | repo already special-cases sso:// URLs to behave similarly to https:// and rpc:// elsewhere in repo, but it forgot to do so here. Noticed when trying to use relative URLs in a manifest obtained using an sso:// URL. Change-Id: Ia11469a09bbd6e444dbc4f22c82f9bbe9f5fd083
* implement optional 'pushurl' in the manifest fileSteve Rae2016-09-201-1/+9
| | | | | | | | Allow the 'remote' element in the manifest file to define an optional 'pushurl' attribute which is passed into the .git/config file. Change-Id: If342d299d371374aedc4440645798888869c9714 Signed-off-by: Steve Rae <steve.rae@raedomain.com>
* pylint: fix indentation in manifest_xmlStefan Beller2016-06-171-1/+1
| | | | | | | | | | This fixes pylint warning: ************* Module manifest_xml W:975, 0: Bad indentation. Found 8 spaces, expected 6 (bad-indentation) Change-Id: I967212f9439430351836ebdc27e442d7b77476e2 Signed-off-by: Stefan Beller <sbeller@google.com>
* Fix XmlManifest.Save with remotes that have 'alias' setDan Willemsen2016-04-221-5/+8
| | | | | | | | | | | | When the alias attribute is set for a remote, the RemoteSpec attached to a Project only contains the alias name used by git, not the original name used in the manifest. But that's not enough information to reconstruct the manifest, so save off the original manifest name as another RemoteSpec parameter, only used to write the manifest out. Bug: Issue 181 Bug: Issue 219 Change-Id: Id7417dfd6ce5572e4e5fe14f22924fdf088ca4f3
* GITC: Always update the gitc manifest from the repo manifestv1.12.31Dan Willemsen2015-09-091-2/+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: I435235cb5622a048ffad0059affd32ecf71f1f5b
* Revert "GITC: Always update the gitc manifest from the repo manifest"Dan Willemsen2015-09-091-3/+2
| | | | | | This reverts commit 250303b437855c2b50d052a05a08ed517423af8b. Change-Id: I1fd8af20f802553151aacb953c913f3305ca6057
* GITC: Always update the gitc manifest from the repo manifestDan Willemsen2015-09-091-2/+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: Pull GITC Manifest Dir from the config.Simran Basi2015-08-311-1/+1
| | | | | | | 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-2/+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
* 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
* Include dest-branch attribute in the 'manifest' subcommand's outputSimon Ruggier2015-07-311-0/+6
| | | | Change-Id: If4227d02005fddea82d9e698a373222100d8f710
* Always output upstream if specifiedConley Owens2015-07-101-5/+7
| | | | | | | | | Previously, in running the `manifest` command, we wouldn't output the upstream if the default upstream would include the pinned sha1. However, now that fetching refs/heads/* doesn't guarantee that we will have the sha1, we need to always output the specified upstream branch. Change-Id: Ib8b409a8ecd439397b38ee9649c530407797f841
* Fix substitution err for schemeless manifest urlsv1.12.22Conley Owens2015-04-291-1/+2
| | | | | | | | Previously, we used a regex that would only remove a phony string from a url if it existed, but we recently replaced that with a slice. This change goes back to the previous behavior. Change-Id: I8baf527be01c4b49d45b903b31a1cd6315563d5b
* Resolve fetch urls more efficientlyAnthony King2015-03-311-16/+9
| | | | | | | | | | | Instead of using regex, append the netloc and relative scheme lists with the custom scheme. The schemes will only be appended when needed, instead of passing X amount of regex replaces. see http://bugs.python.org/issue18828 for more details. Change-Id: I10d26d5ddc32e7ed04c5a412bdd6e13ec59eb70f
* Revert "Implementation of manifest defined githooks"v1.12.20Jonathan Nieder2015-03-171-22/+2
| | | | | | | | | | | | | | | This reverts commit 38e4387f8eb8cffd6359d726c38a7c524fef07e3. A "repo init" followed by "repo sync" is meant to be as safe as "git clone". In particular it should not run arbitrary code provided by the manifest owner. It would still be nice to have support for manifest-defined git hooks --- they'd just need a prompt like the upload RepoHook has. Hopefully a later change can bring them back. Change-Id: I5ecd90fb5c2ed64f103d856d1ffcba38a47b062d Signed-off-by: Jonathan Nieder <jrn@google.com>
* Implementation of manifest defined githooksJimmie Wester2015-02-031-2/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When working within a team or corporation it is often useful/required to use predefined git templates. This change teaches repo to use a per-remote git hook template structure. The implementation is done as a continuation of the existing projecthook functionality. The terminology is therefore defined as projecthooks. The downloaded projecthooks are stored in the .repo directory as a metaproject separating them from the users project forest. The projecthooks are downloaded and set up when doing a repo init and updated for each new repo init. When downloading a mirror the projecthooks gits are not added to the bare forest since the intention is to ensure that the latest are used (allows for company policy enforcement). The projecthooks are defined in the manifest file in the remote element as a subnode, the name refers to the project name on the server referred to in the remote. <remote name="myremote ..> <projecthook name="myprojecthookgit" revision="myrevision"/> </remote> The hooks found in the projecthook revision supersede the stock hooks found in repo. This removes the need for updating the projecthook gits for repo stock hook changes. Change-Id: I6796b7b0342c1f83c35f4b3e46782581b069a561 Signed-off-by: Patrik Ryd <patrik.ryd@stericsson.com> Signed-off-by: Ian Kumlien <ian.kumlien@gmail.com>
* Merge "Add extend-project tag to support adding groups to an existing project"Conley Owens2014-09-181-2/+22
|\