summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Coldrick <adam.coldrick@codethink.co.uk>2014-07-09 15:41:56 +0000
committerAdam Coldrick <adam.coldrick@codethink.co.uk>2014-07-14 13:44:18 +0000
commitaf3464e343bcc1f73f7a54741b66dd02cb2d8151 (patch)
tree6f4d22f0cf873dfd858d96c635d3e03bd7491217
parent0731a00c37b84cfbc6a7215a4c2d7fd49f37d50f (diff)
downloadmorph-af3464e343bcc1f73f7a54741b66dd02cb2d8151.tar.gz
Add morphology repo and ref to Source objects
-rw-r--r--morphlib/source.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/morphlib/source.py b/morphlib/source.py
index 2dbabad1..92d50a77 100644
--- a/morphlib/source.py
+++ b/morphlib/source.py
@@ -29,6 +29,8 @@ class Source(object):
* ``sha1`` -- the absolute git commit id for the revision we use
* ``tree`` -- the SHA1 of the tree corresponding to the commit
* ``morphology`` -- the in-memory representation of the morphology we use
+ * ``morphology_repo`` -- the repo containing the morphology
+ * ``morphology_ref`` -- the ref in the repo containing the morphology
* ``filename`` -- basename of the morphology filename
* ``artifacts`` -- the set of artifacts this source produces.
* ``split_rules`` -- rules for splitting the source's produced artifacts
@@ -36,13 +38,20 @@ class Source(object):
'''
def __init__(self, repo_name, original_ref, sha1, tree, morphology,
- filename):
+ filename, morphology_repo=None, morphology_ref=None):
self.repo = None
self.repo_name = repo_name
self.original_ref = original_ref
self.sha1 = sha1
self.tree = tree
self.morphology = morphology
+ # Assume that morphology repo and ref are the same as the source
+ # unless they are given.
+ self.morphology_repo = repo_name
+ self.morphology_ref = original_ref
+ if morphology_repo is not None and morphology_ref is not None:
+ self.morphology_repo = morphology_repo
+ self.morphology_ref = morphology_ref
self.filename = filename
kind = morphology['kind']