diff options
author | Richard Maw <richard.maw@codethink.co.uk> | 2015-05-06 11:26:47 +0000 |
---|---|---|
committer | Richard Maw <richard.maw@codethink.co.uk> | 2015-05-06 14:00:26 +0000 |
commit | bf996168cb969c559d457d3877197c070ae48d66 (patch) | |
tree | 6d3f91f574427a184d79306771db67b24f8f504b | |
parent | 1651a358278d42506c7a8cbeed11b17d3ec283ee (diff) | |
download | morph-bf996168cb969c559d457d3877197c070ae48d66.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.
-rw-r--r-- | morphlib/plugins/anchor_plugin.py | 11 |
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) |