summaryrefslogtreecommitdiff
path: root/morphlib/morphset_tests.py
Commit message (Collapse)AuthorAgeFilesLines
* Use the modern way of the GPL copyright header: URL instead real addressJavier Jardón2015-03-161-3/+2
| | | | Change-Id: I992dc0c1d40f563ade56a833162d409b02be90a0
* Rename morph3 to morphologyAdam Coldrick2014-08-141-3/+3
| | | | | | Instead of leaving morph3 with a potentially confusing name, rename it to `morphology` since it is now the only implementation of the Morphology class.
* Remove petrify and unpetrify commandsRichard Maw2014-08-121-15/+0
| | | | | | | We don't use this any more, and instead prefer to always keep definitions.git petrified, and update the refs ourselves. branch-from-image still uses some of the remaining petrify code.
* Use exact filenames to refer to morphology filesRichard Maw2014-07-101-3/+3
| | | | | | | | | | | | | | | | | | | Rather than repeatedly stripping and appending an optional .morph extension morphology names, instead always use the file path of the morphology relative to the definitions repository. This is an inversion of the previous logic, which would strip the .morph extension and use the "name" internally. The exception to this rule of always using the filename, is that `morph edit CHUNK` uses the name of the morphology as-defined in the stratum. This is based off Adam Coldrick's inital patch, but this version will allow the old style of providing the "name" by converting it into a path if it does not have either a / or a . in it. An unfortunate consequence of this change is that the show-dependencies command's output changed, so the test needed updating.
* Remove code made vestigial from the `morph edit` rewriteRichard Maw2014-07-071-22/+1
| | | | | | This was originally used by `morph edit`, but since we removed the need to run `morph edit system stratum` and could shorten it to `morph edit chunk`, this function is no longer used.
* MorphSet: add unpetrify_all() methodRichard Maw2013-09-241-0/+14
| | | | | Add an unpetrify method to MorphSet, since it's a good place to put it and may be needed for merge.
* MorphSet: Add method for changing refs en-masseRichard Maw2013-09-241-0/+14
| | | | | 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-241-0/+17
| | | | | | | | | | | | | 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-241-0/+6
| | | | | | | 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-241-0/+3
| | | | | | | | | | | | | | | | | | 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.
* MorphSet: keep old ref as unpetrify-refRichard Maw2013-09-051-2/+6
| | | | | | | | | | | | | | | | | | | This makes petrify much simpler, since adding unpetrify-ref is handled by MorphSet. This has the side-effect of adding unpetrify-ref when editing, but this information is also useful for this use-case. The edit tests now have different diffs and commits, so those have been updated. Also, the old merge code currently warns that now there appears to be petrified changes, since it detects if a branch is petrified by the presence of the unpetrify-ref field, even though the ref is not a SHA1. The old code does not handle undoing an edit the new way, so I did not feel it was worth attempting to comprehend it to fix this bug, which will be later fixed by the introduction of the new merge code.
* Add a MorphologySet class, for changing many morphologiesLars Wirzenius2013-08-141-0/+180
Various parts of Morph need to change a set of morphologies at once, particularly for petrification and unpetrification. This is easiest done by loading all the morphologies into memory at once, and changing them there, then saving again.