diff options
author | Jannis Pohlmann <jannis.pohlmann@codethink.co.uk> | 2012-04-11 13:15:31 +0100 |
---|---|---|
committer | Jannis Pohlmann <jannis.pohlmann@codethink.co.uk> | 2012-04-11 13:42:57 +0100 |
commit | 5afd3d7ce64b762acb228f7f6b4f0326d030807b (patch) | |
tree | 75996c6ca35f742fdec74e300bce2662c3c7abcf /morphlib/source.py | |
parent | d1f60363d74a579ee8eee22e0b03494d63dee830 (diff) | |
download | morph-5afd3d7ce64b762acb228f7f6b4f0326d030807b.tar.gz |
Add original_ref member to Source. Default to None for build-depends.
We will almost always want to look up sources based on the data we find
in morphologies (e.g. chunk sources found in a stratum or strata found
in a system). For that we need to remember the original_ref in addition
to the resolved SHA1 and look up sources using this original ref. The
original ref is therefore also used as part of the hash key in
SourcePool now.
Diffstat (limited to 'morphlib/source.py')
-rw-r--r-- | morphlib/source.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/morphlib/source.py b/morphlib/source.py index 33549df4..cfcd320b 100644 --- a/morphlib/source.py +++ b/morphlib/source.py @@ -24,6 +24,7 @@ class Source(object): Has the following properties: * ``repo`` -- the git repository which contains the source + * ``original_ref`` -- the git ref provided by the user or a morphology * ``sha1`` -- the absolute git commit id for the revision we use * ``morphology`` -- the in-memory representation of the morphology we use * ``filename`` -- basename of the morphology filename @@ -35,9 +36,10 @@ class Source(object): ''' - def __init__(self, repo, sha1, morphology, filename): + def __init__(self, repo, original_ref, sha1, morphology, filename): assert type(morphology) == morphlib.morph2.Morphology self.repo = repo + self.original_ref = original_ref self.sha1 = sha1 self.morphology = morphology self.filename = filename |