From af5866c94ec111c2f2b2cf61f53462088b7c919e Mon Sep 17 00:00:00 2001 From: Richard Maw Date: Wed, 29 Apr 2015 20:36:13 +0000 Subject: 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 --- morphlib/plugins/anchor_plugin.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'morphlib/plugins') 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) -- cgit v1.2.1