From bf996168cb969c559d457d3877197c070ae48d66 Mon Sep 17 00:00:00 2001 From: Richard Maw Date: Wed, 6 May 2015 11:26:47 +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. --- morphlib/plugins/anchor_plugin.py | 11 ++++++----- 1 file 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) -- cgit v1.2.1