summaryrefslogtreecommitdiff
path: root/morphlib
Commit message (Collapse)AuthorAgeFilesLines
* build-without-push: Handle null repo/refRichard Maw2013-10-141-2/+2
| | | | | | | | | | | | | | This wasn't working, since the build-without-push code works by including morphologies that have had their ref changed to the branch's name. This is not done by edit if it is null, since the extra ref resolution can cause interesting issues. Instead of changing edit to continue to alter the ref, build will now allow null meaning this current repo/ref. This has the side-effect of also checking morphologies referred to by a null ref, even if they aren't altered, but it still works correctly.
* Reduced debug output for environment propertiesDan Firth2013-10-141-1/+2
|
* Merge branch 'danielfirth/RT193'Daniel Firth2013-10-116-14/+21
|\ | | | | | | | | Reviewed by: Lars Wirzenius Reviewed by: Pedro Alvarezwq
| * Added chunkname prefix to some elements of the debug log.Dan Firth2013-10-116-14/+21
| |
* | Merge branch 'danielfirth/RT219'Daniel Firth2013-10-111-1/+1
|\ \ | | | | | | | | | | | | Reviewed by Lars Wirzenius Reviewd by Richard Ipsum
| * | Morph now executes extensions in the repository containing the morphologiesDaniel Firth2013-09-261-1/+1
| | |
* | | Merge remote-tracking branch 'remotes/origin/danielfirth/RT174'Lars Wirzenius2013-10-101-1/+1
|\ \ \ | | | | | | | | | | | | | | | | Changed the message according to suggestion by Rob Kendrick, supported by Daniel Silverstone.
| * | | Changed 'figuring out the right build order' to 'Computing artifact graph'Daniel Firth2013-10-071-1/+1
| | |/ | |/|
* | | Merge branch 'danielfirth/RT240'Daniel Firth2013-10-101-0/+14
|\ \ \ | | | | | | | | | | | | | | | | Reviewed by: Lars Wirzenius Reviewed by: Pedro Alvarez
| * | | Morph now validates the 'tarball-server' option as a urlDaniel Firth2013-10-101-0/+14
| |/ /
* | | Merge remote-tracking branch 'origin/baserock/richardipsum'Lars Wirzenius2013-10-081-2/+3
|\ \ \ | | | | | | | | | | | | | | | | Reviewed-by: Lars Wirzenius Reviewed-by: Richard Maw
| * | | Fix bug in autotools versionRichard Ipsum2013-10-081-2/+3
| |/ /
* | | Merge remote-tracking branch 'origin/danielfirth/RT241'Lars Wirzenius2013-10-082-2/+6
|\ \ \ | | | | | | | | | | | | | | | | Reviewed-by: Lars Wirzenius Reviewed-by: Richard Maw
| * | | Added 'description' field to static defaults for cluster morphologiesDan Firth2013-10-072-2/+6
| |/ /
* | | Merge remote-tracking branch 'origin/danielfirth/RT189'Lars Wirzenius2013-10-088-124/+41
|\ \ \ | |/ / |/| | | | | Changed the error (exception) to list all obsolete fields.
| * | Re-enabled validation for morph editDan Firth2013-10-011-10/+0
| | |
| * | 'system-kind' and 'disk-size' system morphology fields now raise ↵Dan Firth2013-10-012-0/+39
| | | | | | | | | | | | ObsoleteFieldError
| * | Dropped support for 'system-kind' from system morphology filesDan Firth2013-09-277-56/+0
| | |
| * | Dropped support for 'disk-size' from system morphology files'Dan Firth2013-09-275-58/+1
| |/
* | Merge branch 'baserock/richardmaw/S8847/branch-from-image-v3'Jonathan Maw2013-09-305-45/+312
|\ \ | | | | | | | | | | | | Reviewed-by: Lars Wirzenius <lars.wirzenius@codethink.co.uk> Reviewed-by: Jonathan Maw <jonathan.maw@codethink.co.uk>
| * | B&M: refactor branch-from-imageRichard Maw2013-09-252-9/+107
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This changes the interface of branch-from-image to only take 1 parameter, the name of the new system branch, as the root repository is loaded from the metadata. This was also what the previous version of branch-from-image did, but that silently ignored the parameter. Given there are not many users of branch-from-image, I felt it was a reasonable change.
| * | morphlib: Add SystemMetadataDir classRichard Maw2013-09-253-0/+163
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This provides access to the /baserock directory as if it were a dict, abstracting away the details of how to get data out of it. The abstraction is useful since it is easier to use than accessing /baserock yourself, and allows the storage format to be changed more easily. Keys with / in may be supported in the future. since there have been discussions about allowing morphologies to be placed in subdirectories. Adding this support would require creating and removing directory components when values are set and deleted respectively. Iterating would require using os.walk instead of glob.iglob, since python doesn't support ** in globs.
| * | b&m: checkout and branch use context managerRichard Maw2013-09-251-36/+7
| | |
| * | b&m: Add system branch initializing context managerRichard Maw2013-09-251-0/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This creates an object that the with statement can use to handle the context and clean up the workspace if the body raises an exception. This is roughly equivalent to having a function that takes a callback of what to do while the branch is being initialized, but with less boilerplate at the call site. contextlib is used to create a context manager from a generator function. This is less verbose than defining a class with __enter__ and __exit__ methods.
* | | Make branch commands work with null refsRichard Maw2013-09-262-4/+11
| | |
* | | Allow building with null repo/refRichard Maw2013-09-264-9/+14
| |/ |/|
* | Merge branch 'baserock/larswirzenius/S8698-morph-help-fmt'Lars Wirzenius2013-09-251-0/+25
|\ \ | |/ |/| | | | | Reviewed-by: Richard Maw Reviewed-by: Pedro Alvarez
| * Avoid formatting "morph help foo" outputLars Wirzenius2013-09-241-0/+25
| | | | | | | | | | | | | | | | The cliapp formatting doesn't understand Markdown. Adding Markdown support in Morph is more work than there is time for right now, but we'll do it later. This quick hack just means we output the raw Markdown rather than something that is incomprehensible due to ruined formatting.
* | Make cross-bootstrap successfully build everythingJonathan Maw2013-09-241-7/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This does three things: 1. It makes sure that the native-bootstrap script terminates if any steps fail. 2. It installs files to a temporary directory, then copies them out, so that builds don't break in cases where we delete files from DESTDIR. 3. It makes appropriate minor fixes so that a cross-bootstrap build can happen from beginning to end. Note: native-bootstrap does not succeed in every case. It has been observed to fail in an x86_64 virtual machine.
* | b&m: Use new MorphSet api in unpetrifyRichard Maw2013-09-241-23/+1
| |
* | MorphSet: add unpetrify_all() methodRichard Maw2013-09-242-0/+27
| | | | | | | | | | Add an unpetrify method to MorphSet, since it's a good place to put it and may be needed for merge.
* | b&m: Refactor petrify to use new morphset methodsRichard Maw2013-09-241-17/+12
| |
* | MorphSet: Add method for changing refs en-masseRichard Maw2013-09-242-0/+34
| | | | | | | | | | This is used to change all the refs of the morphologies in the root repository to point to the system branch instead.
* | MorphSet: Add petrify_chunks() methodRichard Maw2013-09-242-1/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | petrify_chunks handles regular petrification and branch_from_image's petrifying to another point in time. It is given the values to petrify to, instead of doing the ref resolution itself, since now it will consistently resolve refs to the same thing, and a different resolution can be passed in to petrify to another point in time. It only petrifies chunks, since petrifying strata and systems is a more complex operation that is not currently handled anyway.
* | MorphSet: add a list_refs() methodRichard Maw2013-09-242-0/+26
| | | | | | | | | | | | | | This will be used to factor the morphology traversal code out of petrify, since it is cleaner to find out which refs are present, resolve them, then update them, instead of the previous approach which updated as part of the traversal.
* | MorphSet: Factor traversal logic out of change_refRichard Maw2013-09-242-21/+69
|/ | | | | | | | | | | | | | | | | | Tweaking all the morphology specs in a MorphologySet is a common operation. - Edit does it to rewrite refs - petrify does it to fix refs to their state at the current point in time - unpetrify does this to reverse the petrify operation - branch-from-image works similarly to petrify After the refs inside morphologies are tweaked, any morphologies in the MorphSet that are referred to by the changed ref are also updated. This was previously an operation of change_ref, but it will be useful for the other use cases. Changes other than refs are not handled, since there are currently no use cases for it.
* Fix the graphing_plugin so it actually worksLars Wirzenius2013-09-231-3/+2
|
* Remove --staging-chroot, --staging-filler optionsLars Wirzenius2013-09-172-38/+0
| | | | | This also removes the long-obsolete code to install staging fillers in the staging area. We've not allowed users to do that for ages now.
* b&m: Use new-status as the defaultRichard Maw2013-09-172-2/+2
| | | | The previous status is currently still available as old-status.
* b&m: morph new-status provides per-branch statusRichard Maw2013-09-171-1/+23
|
* gitdir: Add method for getting uncommitted changesRichard Maw2013-09-172-0/+37
| | | | | | | | | | get_uncommitted_changes() is needed for morph status to tell if git repositories have changes in them. _get_status() is private, since it does not currently have a user, the small amount of code in get_uncommitted_changes() wrapping _get_status() is in the GitDirectory class instead of the branch and merge plugin, since `morph build` will also need to know about uncommitted changes.
* gitdir: add HEAD property to find the current branchRichard Maw2013-09-172-0/+15
| | | | | This is needed for status to tell if a repo is checked out in an unexpected branch.
* b&m: Add new-status subcommandRichard Maw2013-09-171-0/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This currently performs the workspace-wide status, but not the system-branch status functionality of the older status subcommand. A quick estimate showed the new code to be 5x faster, comparing # time (echo 2 >/proc/sys/vm/drop_caches; morph status) System branches in current workspace: baserock/richardmaw/S8537/ssh-copy-id baserock/richardmaw/S8564/ro-staging-area baserock/richardmaw/S8591/lzo-shared baserock/richardmaw/cliapp-pipefail baserock/richardmaw/malformed-strata-test master tutorial-1/tutorial/master tutorial-1/tutorial/update-ssh real 0m2.517s user 0m0.998s sys 0m1.482s # time (echo 2 >/proc/sys/vm/drop_caches; morph new-status) System branches in current workspace: baserock/richardmaw/S8537/ssh-copy-id baserock/richardmaw/S8564/ro-staging-area baserock/richardmaw/S8591/lzo-shared baserock/richardmaw/cliapp-pipefail baserock/richardmaw/malformed-strata-test master tutorial-1/tutorial/master tutorial-1/tutorial/update-ssh real 0m0.506s user 0m0.207s sys 0m0.233s
* workspace: add method for listing system branchesRichard Maw2013-09-172-0/+15
|
* util: add find_leaves() supplimenting find_leaf()Richard Maw2013-09-173-21/+26
| | | | | | | | | | | | | | | The workspace needs to be able to list all its system branches, and the system branches need to be able to list all their git repositories. This is broadly the same thing, just with a different directory to look out for, so provide that utility in morphlib.util. find_leaf() is rewritten to use find_leaves(), this is less efficient since it waits until every leaf is found. I felt it was better to reduce the code than maintain a slightly more optimal algorithm. The find_leaf() algorithm could become more optimal if it could lazily check for at least one result in a generator.
* Merge branch 'baserock/richardmaw/S8717/refactor-petrify-v4'Richard Maw2013-09-1611-12/+478
|\ | | | | | | | | | | | | | | Reviewed-by: Lars Wirzenius Reviewed-by: Daniel Silverstone Daniel gave his +1 with the caveat that he would like tests for petrifying a system branch other than master.
| * b&m: re-implement morph unpetrifyRichard Maw2013-09-052-2/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This also undoes the test suite change to keep it using the old petrify. Petrify and Unpetrify have the same structure: 1. Set up 2. Load all the morphologies 3. Make changes to the morphologies 4. Write back any changes This suggests some re-use in the form of passing a function callback to a morphology visitor.
| * b&m: Re-implement morph petrifyRichard Maw2013-09-052-1/+92
| | | | | | | | | | This includes amending the test suite to use the old petrify, since the old unpetrify depends on some implementation details of it.
| * morphlib: Add MorphologyFinder classRichard Maw2013-09-053-0/+183
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MorphologyFinder is a small wrapper on top of GitDirectory that allows the inspection of morphologies in the repository. Its purpose is to isolate the logic for reading morphologies into one place. It is used by passing a GitDirectory and optionally a ref to the MorpholgyFinder constructor, then list_morphologies and read_morphology may be used. The ref is passed directly to the GitDirectory, so its semantics for a ref of None or omitted are used. i.e. It uses the working tree. Ref resolving is deferred until a morphology is listed or read, so it will not raise an exception for an invalid ref until then.
| * gitdir: Add methods to inspect contentsRichard Maw2013-09-052-0/+142
| | | | | | | | | | | | This adds methods to list and read files. The difference between doing this to a commit and the currrent working tree is abstracted over by whether the passed ref is None or omitted.