summaryrefslogtreecommitdiff
path: root/morphlib/morphset.py
diff options
context:
space:
mode:
Diffstat (limited to 'morphlib/morphset.py')
-rw-r--r--morphlib/morphset.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/morphlib/morphset.py b/morphlib/morphset.py
index 2343cbae..3c07d58e 100644
--- a/morphlib/morphset.py
+++ b/morphlib/morphset.py
@@ -272,3 +272,16 @@ class MorphologySet(object):
self._traverse_specs(process_chunk_spec, wanted_chunk_spec)
+ def unpetrify_all(self):
+ '''If a spec is petrified, unpetrify it.
+
+ '''
+
+ def wanted_spec(m, kind, spec):
+ return ('unpetrify-ref' in spec and
+ morphlib.git.is_valid_sha1(spec['ref']))
+ def process_spec(m, kind, spec):
+ spec['ref'] = spec.pop('unpetrify-ref')
+ return True
+
+ self._traverse_specs(process_spec, wanted_spec)