diff options
author | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2014-07-07 15:06:33 +0100 |
---|---|---|
committer | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2014-07-07 15:06:33 +0100 |
commit | c1cbbdd036fb50e2a8cac466bc6b332250297d64 (patch) | |
tree | 185e204a874c085b625d2ca536593ceba3f26833 /morphlib/app.py | |
parent | 770a6cb434ac31238eb2eee526e235728ce07aff (diff) | |
parent | c029130068e3a08c51dd551fda88cc5302671d53 (diff) | |
download | morph-c1cbbdd036fb50e2a8cac466bc6b332250297d64.tar.gz |
Merge branch 'sam/update-gits-fix'
Reviewed-By: Pedro Alvarez <pedro.alvarez@codethink.co.uk>
Reviewed-By: Adam Coldrick <adam.coldrick@codethink.co.uk>
Diffstat (limited to 'morphlib/app.py')
-rw-r--r-- | morphlib/app.py | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/morphlib/app.py b/morphlib/app.py index 07e6348f..df8c360a 100644 --- a/morphlib/app.py +++ b/morphlib/app.py @@ -306,14 +306,9 @@ class Morph(cliapp.Application): ''' absref = None - def cached_repo_requires_update_for_ref(repo, ref): - # Named refs that are valid SHA1s will confuse this code. - ref_can_change = not morphlib.git.is_valid_sha1(ref) - return (ref_can_change or not repo.ref_exists(ref)) - if lrc.has_repo(reponame): repo = lrc.get_repo(reponame) - if update and cached_repo_requires_update_for_ref(repo, ref): + if update and repo.requires_update_for_ref(ref): self.status(msg='Updating cached git repository %(reponame)s ' 'for ref %(ref)s', reponame=reponame, ref=ref) repo.update() @@ -347,23 +342,19 @@ class Morph(cliapp.Application): morph_factory = morphlib.morphologyfactory.MorphologyFactory(lrc, rrc, self) queue = collections.deque(triplets) - updated_repos = set() resolved_refs = {} resolved_morphologies = {} while queue: reponame, ref, filename = queue.popleft() - update_repo = update and reponame not in updated_repos # Resolve the (repo, ref) reference, cache result. reference = (reponame, ref) if not reference in resolved_refs: resolved_refs[reference] = self.resolve_ref( - lrc, rrc, reponame, ref, update_repo) + lrc, rrc, reponame, ref, update) absref, tree = resolved_refs[reference] - updated_repos.add(reponame) - # Fetch the (repo, ref, filename) morphology, cache result. reference = (reponame, absref, filename) if not reference in resolved_morphologies: |