summaryrefslogtreecommitdiffstats
path: root/subcmds/manifest.py
Commit message (Collapse)AuthorAgeFilesLines
* manifest: drop support for local_manifest.xmlMike Frysinger2020-09-081-1/+1
| | | | | | | | | | 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>
* When writing manifest, set the dest-branch attribute for projectsSean McAllister2020-04-201-2/+9
| | | | | | | | | | | | | | 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>
* Expose upstream and dest-branch attributes through environmentSean McAllister2020-04-161-0/+5
| | | | | | | | | | | | | | | | | | | | | | Recent changes in ChromeOS Infra to ensure we're reading from snapshot manifests properly have exposed several bugs in our assumptions about manifest files. Mainly that the revision field for a project does _not_ have to refer to a ref, it can just be a commit hash. Several places assume that the revision field can be parsed as a ref to get the branch the project is on, which isn't true. To fix this we need to be able to look at the upstream and dest-branch attributes of the repo, so we expose them through the environment variables set in `repo forall`. Test: manual 'repo forall' run Bug: https://crbug.com/1032441 Change-Id: I2c039e0f4b2e0f430602932e91b782edb6f9b1ed Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/263132 Reviewed-by: Mike Frysinger <vapier@google.com> Tested-by: Sean McAllister <smcallis@google.com>
* manifest: support optional --manifest-nameSean McAllister2020-02-221-1/+7
| | | | | | | | | | | Still use the repo manifest by default as before, but gives us the option of overriding it to support e.g.: using a subset of the full manifest. Change-Id: Ia42cd1cb3a0a58929d31bb01c9724e9d31f68730 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/256372 Reviewed-by: Mike Frysinger <vapier@google.com> Tested-by: Sean McAllister <smcallis@google.com>
* Fix blank line issues reported by flake8David Pursehouse2020-02-121-0/+1
| | | | | | | | | | | | | | | | | | | | - 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 flake8 E251 unexpected spaces around keyword / parameter equalsDavid Pursehouse2020-02-121-2/+2
| | | | | | | | | | | 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>
* use open context managers in more placesMike Frysinger2019-11-121-4/+3
| | | | | | | | | | Use open() as a context manager to simplify the close logic and make the code easier to read & understand. This is also more Pythonic. Change-Id: I579d03cca86f99b2c6c6a1f557f6e5704e2515a7 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/244734 Reviewed-by: David Pursehouse <dpursehouse@collab.net> Tested-by: Mike Frysinger <vapier@google.com>
* split out cli validation from executionv1.13.5Mike Frysinger2019-08-281-8/+3
| | | | | | | | | | | | | | | | | | | A common pattern in our subcommands is to verify the arguments & options before executing things. For some subcommands, that check stage is quite long which makes the execution function even bigger. Lets split that logic out of the execute phase so it's easier to manage these. This is most noticeable in the sync subcommand whose Execute func is quite large, and the option checking makes up ~15% of it. The manifest command's Execute can be simplified significantly as the optparse configuration always sets output_file to a string. Change-Id: I7097847ff040e831345e63de6b467ee17609990e Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/234834 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
* manifest-format: convert to markdownMike Frysinger2018-10-051-1/+1
| | | | | | | The gitiles system doesn't render .txt files, so convert this to .md for better display online. Change-Id: Ie12e46daf008dd8c97ae2ffd21fb68bd948fe625
* Change print statements to work in python3Sarah Owens2012-11-131-3/+4
| | | | | | This is part of a series of changes to introduce Python3 support. Change-Id: I373be5de7141aa127d7debdbce1df39148dbec32
* Coding style cleanupDavid Pursehouse2012-10-091-3/+3
| | | | | | | | | | | | | | | Fix the following issues reported by pylint: C0321: More than one statement on a single line W0622: Redefining built-in 'name' W0612: Unused variable 'name' W0613: Unused argument 'name' W0102: Dangerous default value 'value' as argument W0105: String statement has no effect Also fixed a few cases of inconsistent indentation. Change-Id: Ie0db839e7c57d576cff12d8c055fe87030d00744
* manifest: record the original revision when in -r mode.Brian Harring2012-09-281-1/+7
| | | | | | | | | | | | | | | | | Currently when doing a sync against a revision locked manifest, sync has no option but to fall back to sync'ing the entire refs space; it doesn't know which ref to ask for that contains the sha1 it wants. This sucks if we're in -c mode; thus when we generate a revision locked manifest, record the originating branch- and try syncing that branch first. If the sha1 is found within that branch, this saves us having to pull down the rest of the repo- a potentially heavy saving. If that branch doesn't have the desired sha1, we fallback to sync'ing everything. Change-Id: I99a5e44fa1d792dfcada76956a2363187df94cf1
* `repo manifest`: default to stdout if no "-o"Conley Owens2012-09-041-0/+1
| | | | Change-Id: I1b0ff9ed5df6386f0c2a851c6c48d063199fe663
* Add repo manifest -o to save a manifestv1.6.2Shawn O. Pearce2009-03-051-5/+38
| | | | | | | | | This can be useful to create a new manifest from an existing client, especially if the client wants to use the "-r" option to set each project's revision to the current commit SHA-1, making a sort of a tag file that can be used to recreate this exact state elsewhere. Signed-off-by: Shawn O. Pearce <sop@google.com>
* Add a 'repo manifest' command whose help is the manifest file formatShawn O. Pearce2009-03-041-0/+44
This should make it easier for users to discover the file format on their own, and read about it. Signed-off-by: Shawn O. Pearce <sop@google.com>