diff options
author | Sam Thursfield <sam@afuera.me.uk> | 2014-10-24 16:28:30 +0000 |
---|---|---|
committer | Sam Thursfield <sam@afuera.me.uk> | 2014-10-24 16:33:39 +0000 |
commit | 35178357f0ba7eafdeebfc621d70ba69f2cd270a (patch) | |
tree | f7af3af1949913b69c79d29a3230e4718e5d0f39 /morphlib/app.py | |
parent | 8df5d7df210f9c712c2377cecc6f3f3a7efce01a (diff) | |
download | morph-35178357f0ba7eafdeebfc621d70ba69f2cd270a.tar.gz |
build: Allow passing in the name of the original ref to create_source_pool()
This means that we can force the building of a specific commit without
losing the original branch name in the metadata of the resulting system.
Diffstat (limited to 'morphlib/app.py')
-rw-r--r-- | morphlib/app.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/morphlib/app.py b/morphlib/app.py index 9ab102b3..c3c9c970 100644 --- a/morphlib/app.py +++ b/morphlib/app.py @@ -290,7 +290,8 @@ class Morph(cliapp.Application): morphlib.util.sanitise_morphology_path(args[2])) args = args[3:] - def create_source_pool(self, lrc, rrc, repo, ref, filename): + def create_source_pool(self, lrc, rrc, repo, ref, filename, + original_ref=None): pool = morphlib.sourcepool.SourcePool() def add_to_pool(reponame, ref, filename, absref, tree, morphology): @@ -302,7 +303,8 @@ class Morph(cliapp.Application): self.traverse_morphs(repo, ref, [filename], lrc, rrc, update=not self.settings['no-git-update'], - visit=add_to_pool) + visit=add_to_pool, + definitions_original_ref=original_ref) return pool def resolve_ref(self, lrc, rrc, reponame, ref, update=True): @@ -346,7 +348,8 @@ class Morph(cliapp.Application): def traverse_morphs(self, definitions_repo, definitions_ref, system_filenames, lrc, rrc, update=True, - visit=lambda rn, rf, fn, arf, m: None): + visit=lambda rn, rf, fn, arf, m: None, + definitions_original_ref=None): morph_factory = morphlib.morphologyfactory.MorphologyFactory(lrc, rrc, self) definitions_queue = collections.deque(system_filenames) @@ -359,6 +362,9 @@ class Morph(cliapp.Application): definitions_absref, definitions_tree = self.resolve_ref( lrc, rrc, definitions_repo, definitions_ref, update) + if definitions_original_ref: + definitions_ref = definitions_original_ref + while definitions_queue: filename = definitions_queue.popleft() |