summaryrefslogtreecommitdiff
path: root/morphlib/plugins
diff options
context:
space:
mode:
authorRichard Maw <richard.maw@codethink.co.uk>2015-04-29 20:36:13 +0000
committerRichard Maw <richard.maw@codethink.co.uk>2015-05-11 10:48:53 +0000
commitaf5866c94ec111c2f2b2cf61f53462088b7c919e (patch)
treee3ffb74f1c4b8bd791199616996911528d82e915 /morphlib/plugins
parent6aec7d787094616b820fa15d2f24d3d320d2ba41 (diff)
downloadmorph-af5866c94ec111c2f2b2cf61f53462088b7c919e.tar.gz
morph anchor: Handle updating refs
Previously it would not attempt to make commits it needed locally available if the commit was available on the remote repo cache. Now it will do the update if the commit is not available locally, and will obey --no-git-update. Change-Id: I80f1e351ce334641e2ef733fa4c9a6ab967f9b67
Diffstat (limited to 'morphlib/plugins')
-rw-r--r--morphlib/plugins/anchor_plugin.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/morphlib/plugins/anchor_plugin.py b/morphlib/plugins/anchor_plugin.py
index bd2449b6..f3973418 100644
--- a/morphlib/plugins/anchor_plugin.py
+++ b/morphlib/plugins/anchor_plugin.py
@@ -137,11 +137,12 @@ class AnchorPlugin(cliapp.Plugin):
for reponame, sources in sources_by_reponame.iteritems():
# UGLY HACK we need to push *FROM* our local repo cache to
# avoid cloning everything multiple times.
- # This uses cache_repo rather than get_repo because the
- # BuildCommand.create_source_pool won't cache the
- # repositories locally if it can use a remote cache
- # instead.
- repo = bc.lrc.cache_repo(reponame)
+ # This uses get_updated_repo rather than get_repo because the
+ # BuildCommand.create_source_pool won't cache the repositories
+ # locally if it can use a remote cache instead.
+ repo = bc.lrc.get_updated_repo(reponame,
+ refs=(s.original_ref
+ for s in sources))
remote = Remote(repo.gitdir)
push_url = resolver.push_url(reponame)