summaryrefslogtreecommitdiffstats
path: root/manifest_xml.py
Commit message (Collapse)AuthorAgeFilesLines
...
| * Add extend-project tag to support adding groups to an existing projectJosh Triplett2014-06-201-2/+22
| | | | | | | | | | | | | | | | | | | | | | | | Currently, if a local manifest wants to add groups to an existing project, it must use remove-project and then re-add the project with the new groups. This makes the local manifest more fragile, requiring updates to the local manifest if the original manifest changes. Add a new extend-project tag, which supports adding groups to an existing project. Change-Id: Ib4d1352efd722a65dd263d02644b9ea5ab6ed400
* | Add support for rpc:// protocol schemes.T.R. Fullhart2014-09-101-0/+4
| | | | | | | | Change-Id: I0e500e45cacc20ac04b43435c4bd189299e9e97b
* | Enable transferring of attribute using command 'repo manifest -o -'Mani Chandel2014-07-241-0/+2
|/ | | | | | | | | | | 'upstream' attribute is now transferred to the new manifest xml that is created when using command 'repo manifest -o -'. Manifest help is updated for the attributes 'sync-c','sync-s' and 'sync-j'. Bug: Issue 164 Change-Id: If63f781e91d25c5b5b5ea0696b0c04337b0a686a
* Merge "Enable remotes to define their own revision"Conley Owens2014-05-081-6/+16
|\
| * Enable remotes to define their own revisionAnthony King2014-05-071-6/+16
| | | | | | | | | | | | | | | | | | | | | | | | Some projects use multiple remotes. In some cases these remotes have different naming conventions. Add an option to define a revision in the remote configuration. The `project` revision takes precedence over `remote` and `default`. The `remote` revision takes precedence over `default`. The `default` revision acts as a fall back as it originally did. Change-Id: I2b376160d45d48b0bab840c02a3eef1a1e32cf6d
* | Merge "Return a list rather than dict_values in XmlManifest.projects()"Conley Owens2014-05-071-1/+1
|\ \
| * | Return a list rather than dict_values in XmlManifest.projects()Anthony King2014-05-061-1/+1
| |/ | | | | | | | | | | | | dict.values() produce dict_values objects rather than list objects. Convert this to a list to maintain functionality with certain functions. Change-Id: Ie76269e19f8d68479a1d7ae03aa965252d759a9e
* / Use sorted() rather than .sort()Anthony King2014-05-061-4/+2
|/ | | | | | | dict.keys() produces a dict_keys object in Python 3, which does not support .sort(). Use sorted() which will give the same outcome. Change-Id: If6b33db07a31995b4e44959209d08d8fb74ae339
* Add linkfile support.Jeff Hamilton2014-04-221-0/+16
| | | | | | | | | It's just like copyfile and runs at the same time as copyfile but instead of copying it creates a symlink instead. This is needed because copyfile copies the target of the link as opposed to the symlink itself. Change-Id: I7bff2aa23f0d80d9d51061045bd9c86a9b741ac5
* Fix to mirror manifest when --mirror is givenKwanhong Lee2014-02-201-1/+2
| | | | | | | | | | | | | | | | | | | Commit 8d201 "repo: Support multiple branches for the same project." (Change id is I5e2f4e1a7abb56f9d3f310fa6fd0c17019330ecd) caused missing mirroring manifest repository when 'repo sync' after 'repo init --mirror'. When the function _AddMetaProjectMirror() is called to add two of meta projects - git-repo itself and manifest repository to mirror, it didn't add them into self._paths which has list of projects to be sync'ed by 'repo sync'. In addition, because member var of Project 'relpath' is used as a key of self._paths, it should be set with proper value other than None. Since this is only for meta projects which are not described in manifest xml, 'relpath' is name of the projects. Change-Id: Icc3b9e6739a78114ec70bf54fe645f79df972686 Signed-off-by: Kwanhong Lee <kwanhong.lee@windriver.com>
* Add the "diffmanifests" commandJulien Campergue2014-02-171-1/+38
| | | | | | | | | This command allows a deeper diff between two manifest projects. In addition to changed projects, it displays the logs of the commits between both revisions for each project. Change-Id: I86d30602cfbc654f8c84db2be5d8a30cb90f1398 Signed-off-by: Julien Campergue <julien.campergue@parrot.com>
* Fix persistent-https relative url resolvingConley Owens2014-01-311-8/+10
| | | | | | | | | | | | | | Previously, we would remove 'persistent-' then tack it on at the end if it had been previously found. However, this would ignore urljoin's decision on whether or not the second path was relative. Instead, we were always assuming it was relative and that we didn't want to use a different absolute url with a different protocol. This change handles persistent-https:// in the same way we handled the absense of an explicit protocol. The only difference is that this time instead of temporarily replacing it with 'gopher://', we use 'wais://'. Change-Id: I6e8ad1eb4b911931a991481717f1ade01315db2a
* repo: Fix 'remove-project' regression with multiple projects.v1.12.10David James2014-01-301-3/+6
| | | | | | | In CL:50715, I updated repo to handle multiple projects, but the remove-projects code path was not updated accordingly. Update it. Change-Id: Icd681d45ce857467b584bca0d2fdcbf24ec6e8db
* Merge "repo: Support multiple branches for the same project."Conley Owens2014-01-101-19/+45
|\
| * repo: Support multiple branches for the same project.David James2013-10-141-19/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It is often useful to be able to include the same project more than once, but with different branches and placed in different paths in the workspace. Add this feature. This CL adds the concept of an object directory. The object directory stores objects that can be shared amongst several working trees. For newly synced repositories, we set up the git repo now to share its objects with an object repo. Each worktree for a given repo shares objects, but has an independent set of references and branches. This ensures that repo only has to update the objects once; however the references for each worktree are updated separately. Storing the references separately is needed to ensure that commits to a branch on one worktree will not change the HEAD commits of the others. One nice side effect of sharing objects between different worktrees is that you can easily cherry-pick changes between the two worktrees without needing to fetch them. Bug: Issue 141 Change-Id: I5e2f4e1a7abb56f9d3f310fa6fd0c17019330ecd
* | Add --archive option to init to sync using git archiveJulien Campergue2013-12-101-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This significantly reduces sync time and used brandwidth as only a tar of each project's revision is checked out, but git is not accessible from projects anymore. This is relevant when git is not needed in projects but sync speed/brandwidth may be important like on CI servers when building several versions from scratch regularly for example. Archive is not supported over http/https. Change-Id: I48c3c7de2cd5a1faec33e295fcdafbc7807d0e4d Signed-off-by: Julien Campergue <julien.campergue@parrot.com>
* | Fix a small whitespace consistency issueConley Owens2013-10-161-1/+1
| | | | | | | | Change-Id: Ie98c79833ca5e7ef71666489135f7491223f779c
* | Dan't accessing attr of None (`manifest` subcmd)Conley Owens2013-10-161-1/+3
| | | | | | | | | | | | | | If d.remote is None, this code failed for obvious reasons. This is a simple fix. Change-Id: I413756121e444111f1e3c7dc8bc8032467946c13
* | Fix indentationv1.12.5David Pursehouse2013-10-151-4/+3
| | | | | | | | | | | | | | git-repo uses 2 space indentation. A couple of recent changes introduced 4 space indentation in some modules. Change-Id: Ia4250157c1824c1b5e7d555068c4608f995be9da
* | Merge "Better handling of duplicate default"David Pursehouse2013-10-151-5/+14
|\ \ | |/ |/|
| * Better handling of duplicate defaultJulien Campergue2013-10-101-5/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | Currently, an error is raised if more than one default is defined. When including another manifest, it is likely that a default has been defined in both manifests. Don't raise an error if all the defaults defined have the same attributes. Change-Id: I2603020687e2ba04c2c62c3268ee375279b34a08 Signed-off-by: Julien Campergue <julien.campergue@parrot.com>
* | Respect remote aliasesConley Owens2013-10-081-1/+6
|/ | | | | | | | | | | Previously, change I7150e449341ed8655d398956a095261978d95870 had broken alias support in order to fix the manifest command to keep it from spitting projects that point to an alias that wasn't recorded. This commit reverts that commit and instead solves the issue more correctly, outputting the alias in the remote node of the manifest and respecting that alias when outputting the list of projects. Change-Id: I941fc4adb7121d2e61cedc5838e80d3918c977c3
* Give the node _Default class a destBranchExprConley Owens2013-09-251-0/+1
| | | | | | | | | This is to avoid the following AttributeError: line 681, in _ParseProject AttributeError: '_Default' object has no attribute 'destBranchExpr' Change-Id: Ia9f7e2cce1409d22d71bc8a74b33edf2b27702ca
* Fix urllib.parse (urlparse) handlingChirayu Desai2013-06-111-1/+1
| | | | | | | | | | | | | | | Revert "Fix "'module' object is not callable" error", and fix it properly. * The urlparse module is renamed to urllib.parse in Python 3. * This commit fixes the code to use "urllib.parse.urlparse" instead of creating a new module urlib and setting urlib.parse to urlparse.urlparse. * Fixes an AttributeError: 'function' object has no attribute 'uses_relative' This reverts commit cd51f17c643370e6199216462c1be36f04d57291. Change-Id: I48490b20ecd19cf5a6edd835506ea5a467d556ac
* Fix "'module' object is not callable" errorDavid Pursehouse2013-06-081-1/+1
| | | | | | | | In a couple of files the urlparse method was not being set up correctly for python < 3 and this resulted in an error being thrown when trying to call it. Change-Id: I4d2040ac77101e4e228ee225862f365ae3d96cec
* Send reviews to a different branch from fetchBryan Jacobs2013-05-241-1/+6
| | | | | | | | This adds the ability to have reviews pushed to a different branch from the one on which changes are based. This is useful for "gateway" systems without smartsync. Change-Id: I3a8a0fabcaf6055e62d3fb55f89c944e2f81569f
* Move Python version checking to a separate moduleDavid Pursehouse2013-05-231-5/+5
| | | | | | | | | | | | | | | | | Add a new module with methods for checking the Python version. Instead of handling Python3 imports with try...except blocks, first check the python version and then import the relevant modules. This makes the code a bit cleaner and will result in less diff when/if we remove support for Python < 3 later. Use the same mechanism to handle `input` vs. `raw_input` and add suppression of pylint warnings caused by redefinition of the built-in method `input`. Change-Id: Ia403e525b88d77640a741ac50382146e7d635924 Also-by: Chirayu Desai <cdesai@cyanogenmod.org> Signed-off-by: Chirayu Desai <cdesai@cyanogenmod.org>
* Some fixes for supporting python3Chirayu Desai2013-04-181-32/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | * Fix imports. * Use python3 syntax. * Wrap map() calls with list(). * Use list() only wherever needed. (Thanks Conley!) * Fix dictionary iteration methods (s/iteritems/items/). * Make use of sorted() in appropriate places * Use iterators directly in the loop. * Don't use .keys() wherever it isn't needed. * Use sys.maxsize instead of sys.maxint TODO: * Make repo work fully with python3. :) Some of this was done by the '2to3' tool [1], by applying the needed fixes in a way that doesn't break compatibility with python2. Links: [1]: http://docs.python.org/2/library/2to3.html Change-Id: Ibdf3bf9a530d716db905733cb9bfef83a48820f7 Signed-off-by: Chirayu Desai <cdesai@cyanogenmod.org>
* Allow mirror to be created in directories specified by 'path' attributeScott Fan2013-04-111-0/+4
| | | | | | | | | | | | | In some cases, especially when local manifest files exist, users may want to force the mirrored repositories to be created in folders according to their 'path' attribute in the manifest, rather than according to the name of the repositories. To enable this functionality for specified mirror, add a new attribute 'force-path' for that project in the manifest, set its value to 'true'. Change-Id: I61df8c987a23d84309b113e7d886ec90c838a6cc Signed-off-by: Scott Fan <fancp2007@gmail.com>
* Allow clone depth to be specified per projectDavid Pursehouse2013-04-101-0/+11
| | | | | | | | | | | If the clone-depth attribute is set on a project, its value will be used to set the depth when fetching the git. The value, if given, must be a positive integer. The value in the clone-depth attribute overrides any value given to repo init via the --depth command line option. Change-Id: I273015b3724213600b63e40cca4cafaa9f782ddf
* Fix `repo manifest` support of remote aliases.Brian Harring2013-04-031-2/+0
| | | | | | | | | Long story short, w/out this modification the manifest dump points at the alias, rather than the actual remote for the project. This breaks sync'ing for scenarios where the alias doesn't have the same repos available as the remote, plus just plain is wrong. Change-Id: I7150e449341ed8655d398956a095261978d95870
* Fix: local manifest deprecation warning appears more than onceDavid Pursehouse2013-02-171-3/+6
| | | | | | | | | When running repo sync, the local_manifest.xml deprecation warning is shown twice. Add a flag to ensure that it is only displayed once. Change-Id: Icfa2b0b6249c037c29771f9860252e6eda3ae651
* Exit with fatal error if local manifest file cannot be parsedDavid Pursehouse2013-02-171-5/+2
| | | | | | | | | | | | | If the .repo/local_manifests folder includes a local manifest file that cannot be parsed, the current behaviour is to catch the parse exception, print a warning, and continue to process remaining files. This can cause any errors to go unnoticed. Remove the exception handling, so that the exception is instead caught in main._Main, and repo exits with a fatal error. Change-Id: I75a70b7b850d2eb3e4ac99d435a4568ff598b7f4
* Show full path of `local_manifests` folder in deprecation warningDavid Pursehouse2013-02-171-2/+2
| | | | | | | | | | | | When a local_manifest.xml file is present, a deprecation warning is printed telling the user to put local manifest files in the `local_manifests` directory. Include the full path to the `local_manifests` directory in the warning, to reduce confusion about where the directory should be located. Also enclose the directory name in backticks. Change-Id: I85710cfbd6e77fb2fa6b7b0ce66d77693ccd649f
* Merge "should use os.path.lexist instead of os.path.exist"Shawn Pearce2013-01-281-3/+3
|\
| * should use os.path.lexist instead of os.path.existSebastian Frias2012-11-231-3/+3
| | | | | | | | | | | | | | | | | | | | The logic of the program requires a check on the existence of the link itself See repo issue #125 : https://code.google.com/p/git-repo/issues/detail?id=125 Change-Id: Ia7300d22d6d656259f47c539febf1597f0c35538
* | If parsing the manifests fails, reset the XmlManifest objectJoe Onorato2013-01-171-1/+7
| | | | | | | | | | | | so that if it's called again, we see the correct errors. Change-Id: I909488feeac04aecfc92a9b5d6fb17827ef2f213
* | Merge "Pass full path of the XML in local_manifests to the parser"Conley Owens2013-01-171-1/+2
|\ \
| * | Pass full path of the XML in local_manifests to the parserTobias Droste2013-01-071-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes the following python error message if the current working directory is not .repo/local_manifests: IOError: [Errno 2] No such file or directory: 'local_manifest.xml' Signed-off-by: Tobias Droste <tdroste87@gmail.com> CC: David Pursehouse <david.pursehouse@sonymobile.com> Change-Id: I4668dc04219b6233c7ff6ca3b4138bec9ee3529f
* | | Merge "Make -notdefault a default manifest group"Conley Owens2013-01-141-3/+2
|\ \ \ | |/ / |/| |
| * | Make -notdefault a default manifest groupMatt Gumbel2012-12-211-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When trying to render manifest with SHAs, projects in group notdefault caused the following crash: Traceback (most recent call last): File ".repo/repo/main.py", line 385, in <module> _Main(sys.argv[1:]) File ".repo/repo/main.py", line 365, in _Main result = repo._Run(argv) or 0 File ".repo/repo/main.py", line 137, in _Run result = cmd.Execute(copts, cargs) File ".repo/repo/subcmds/manifest.py", line 129, in Execute self._Output(opt, manifest) File ".repo/repo/subcmds/manifest.py", line 79, in _Output peg_rev = opt.peg_rev) File ".repo/repo/manifest_xml.py", line 199, in Save p.work_git.rev_parse(HEAD + '^0')) File ".repo/repo/project.py", line 2035, in runner capture_stderr = True) File ".repo/repo/git_command.py", line 215, in __init__ raise GitError('%s: %s' % (command[1], e)) error.GitError: rev-parse: [Errno 2] No such file or directory: 'prebuilts/eclipse-build-deps' This patch resolves the issue by making sure that -notdefault is always used as a default manifest group so that notdefault projects are not rendered out by the manifest subcmd. Change-Id: I4a8bd18ea7600309f39ceff1b1ab6e1ff3adf21d Signed-off-by: Matt Gumbel <matthew.k.gumbel@intel.com>
* | | Support resolving relative fetch URLs on persistent-https://v1.12.0Shawn Pearce2013-01-021-1/+8
|/ / | | | | | | | | | | | | | | | | Some versions of Python will only attempt to resolve a relative URL if they understand the URL scheme. Convert persistent-http:// and persistent-https:// schemes to the more typical http:// and https:// versions for the resolve call. Change-Id: I99072d5a69be8cfaa429a3ab177ba644d928ffba
* / Represent git-submodule as nested projects, take 2Che-Liang Chiou2012-11-191-26/+103
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (Previous submission of this change broke Android buildbot due to incorrect regular expression for parsing git-config output. During investigation, we also found that Android, which pulls Chromium, has a workaround for Chromium's submodules; its manifest includes Chromium's submodules. This new change, in addition to fixing the regex, also take this type of workarounds into consideration; it adds a new attribute that makes repo not fetch submodules unless submodules have a project element defined in the manifest, or this attribute is overridden by a parent project element or by the default element.) We need a representation of git-submodule in repo; otherwise repo will not sync submodules, and leave workspace in a broken state. Of course this will not be a problem if all projects are owned by the owner of the manifest file, who may simply choose not to use git-submodule in all projects. However, this is not possible in practice because manifest file owner is unlikely to own all upstream projects. As git submodules are simply git repositories, it is natural to treat them as plain repo projects that live inside a repo project. That is, we could use recursively declared projects to denote the is-submodule relation of git repositories. The behavior of repo remains the same to projects that do not have a sub-project within. As for parent projects, repo fetches them and their sub-projects as normal projects, and then checks out subprojects at the commit specified in parent's commit object. The sub-project is fetched at a path relative to parent project's working directory; so the path specified in manifest file should match that of .gitmodules file. If a submodule is not registered in repo manifest, repo will derive its properties from itself and its parent project, which might not always be correct. In such cases, the subproject is called a derived subproject. To a user, a sub-project is merely a git-submodule; so all tips of working with a git-submodule apply here, too. For example, you should not run `repo sync` in a parent repository if its submodule is dirty. Change-Id: I4b8344c1b9ccad2f58ad304573133e5d52e1faef
* Better error message if 'remove-project' refers to non-existent projectDavid Pursehouse2012-11-161-3/+2
| | | | | | | | | | If a local manifest includes a 'remove-project' element that refers to a project that does not exist in the manifest, the error message is a bit cryptic. Change the error message to make it clearer what is wrong. Change-Id: I0b1043aaec87893c3128211d3a9ab2db6d600755
* Fix inconsistent indentationDavid Pursehouse2012-11-141-22/+22
| | | | | | | | | | The repo coding style is to indent at 2 characters, but there are many places where this is not followed. Enable pylint warning "W0311: Bad indentation" and make sure all indentation is at multiples of 2 characters. Change-Id: I68f0f64470789ce2429ab11104d15d380a63e6a8
* Change print statements to work in python3Sarah Owens2012-11-131-3/+5
| | | | | | This is part of a series of changes to introduce Python3 support. Change-Id: I373be5de7141aa127d7debdbce1df39148dbec32
* Make load order of local manifests deterministicDavid Pursehouse2012-11-141-1/+1
| | | | | | | | | | | Local manifest files stored in the local_manifests folder are loaded in alphabetical order, so it's easier to know in which order project removals/additions/modifications will be applied. If local_manifests.xml exists, it will be loaded before the files in local_manifests. Change-Id: Ia5c0349608f1823b4662cd6b340b99915bd973d5
* Better handling of duplicate remotesDavid Pursehouse2012-11-131-5/+14
| | | | | | | | | | | | | | In the current implementation, an error is raised if a remote with the same name is defined more than once. The check is only that the remote has the same name as an existing remote. With the support for multiple local manifests, it is more likely than before that the same remote is defined in more than one manifest. Change the check so that it only raises an error if a remote is defined more than once with the same name, but different attributes. Change-Id: Ic3608646cf9f40aa2bea7015d3ecd099c5f5f835
* Print deprecation warning when local_manifest.xml is usedDavid Pursehouse2012-11-131-0/+2
| | | | | | | | The preferred way to specify local manifests is to drop the file(s) in the local_manifests folder. Print a deprecation warning when the legacy local_manifest.xml file is used. Change-Id: Ice85bd06fb612d6fcceeaa0755efd130556c4464
* Add support for multiple local manifestsDavid Pursehouse2012-11-131-1/+13
| | | | | | | | | Add support for multiple local manifests stored in the local_manifests folder under the .repo home directory. Local manifests will be processed in addition to local_manifest.xml. Change-Id: Ia0569cea7e9ae0fe3208a8ffef5d9679e14db03b