From b16e99a71980e9f10ff719d749ad8e453704ea83 Mon Sep 17 00:00:00 2001 From: Richard Maw Date: Mon, 2 Sep 2013 13:32:47 +0000 Subject: MorphSet: keep old ref as unpetrify-ref 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. --- morphlib/morphset_tests.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'morphlib/morphset_tests.py') diff --git a/morphlib/morphset_tests.py b/morphlib/morphset_tests.py index 7dbc861a..65fe2058 100644 --- a/morphlib/morphset_tests.py +++ b/morphlib/morphset_tests.py @@ -127,7 +127,8 @@ class MorphologySetTests(unittest.TestCase): { 'repo': 'test:morphs', 'ref': 'new-ref', - 'morph': 'foo-stratum' + 'morph': 'foo-stratum', + 'unpetrify-ref': 'master', }) def test_changes_stratum_ref_in_build_depends(self): @@ -140,6 +141,7 @@ class MorphologySetTests(unittest.TestCase): 'repo': self.stratum.repo_url, 'ref': self.stratum.ref, 'morph': self.stratum['name'], + 'unpetrify-ref': 'master', }, ] }) @@ -157,7 +159,8 @@ class MorphologySetTests(unittest.TestCase): { 'repo': 'test:morphs', 'ref': 'new-ref', - 'morph': 'foo-stratum' + 'morph': 'foo-stratum', + 'unpetrify-ref': 'master', }) def test_changes_chunk_ref(self): @@ -175,6 +178,7 @@ class MorphologySetTests(unittest.TestCase): 'repo': 'test:foo-chunk', 'ref': 'new-ref', 'morph': 'foo-chunk', + 'unpetrify-ref': 'master', } ]) -- cgit v1.2.1