From 0830715fd71e0412a08adfe4a00866ec04ffff4a Mon Sep 17 00:00:00 2001 From: Sam Thursfield Date: Fri, 9 Jan 2015 12:35:04 +0000 Subject: Make lorry not bundle or push by default It doesn't make sense to have Lorry push to a random default mirror server: users running Lorry without setting up any configuration are likely to be testers/developers that don't want it to randomly push stuff to places. It especially doesn't make sense to refer to the Codethink 'roadtrain' server which was decommissioned several years ago. --- lorry | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/lorry b/lorry index 127a1fb..359ee91 100755 --- a/lorry +++ b/lorry @@ -52,15 +52,12 @@ class Lorry(cliapp.Application): metavar='DIR', default='workd') self.settings.string(['mirror-base-url-push'], 'base URL to use for pushing to the mirror ' - 'server (default: %default)', - metavar='URL', - default='ssh://gitano@roadtrain.codethink.co.uk/delta') + 'server', + metavar='URL') self.settings.string(['mirror-base-url-fetch'], 'base URL to use for bundle names and for ' - 'pulling from the mirror server (default: ' - '%default)', - metavar='URL', - default='git://git.baserock.org/delta') + 'pulling from the mirror server', + metavar='URL') self.settings.boolean(['pull-only'], 'only pull from upstreams, do not push to ' 'the mirror server') @@ -123,6 +120,8 @@ class Lorry(cliapp.Application): def bundle(self, name, gitdir): if self.settings['bundle'] == 'never': return + if len(self.settings['mirror-base-url-fetch']) == 0: return + bundlename = "%s/%s" % (self.settings['mirror-base-url-fetch'], name) path = os.path.join(self.settings['bundle-dest'], quote_url(bundlename)) + '.bndl' @@ -147,6 +146,8 @@ class Lorry(cliapp.Application): def make_tarball(self, name, gitdir): if self.settings['tarball'] == 'never': return + if len(self.settings['mirror-base-url-fetch']) == 0: return + tarballname = "%s/%s" % (self.settings['mirror-base-url-fetch'], name) path = os.path.join(self.settings['tarball-dest'], @@ -244,10 +245,11 @@ class Lorry(cliapp.Application): raise if not self.settings['pull-only']: - if 'refspecs' in spec: - self.push_to_mirror_server(name, gitdir, spec['refspecs']) - else: - self.push_to_mirror_server(name, gitdir) + if len(self.settings['mirror-base-url-push']) > 0: + if 'refspecs' in spec: + self.push_to_mirror_server(name, gitdir, spec['refspecs']) + else: + self.push_to_mirror_server(name, gitdir) if backupdir is not None: self.progress('.. removing %s git repository backup' % name) -- cgit v1.2.1