diff options
author | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2015-01-09 12:35:04 +0000 |
---|---|---|
committer | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2015-01-09 12:35:04 +0000 |
commit | 0830715fd71e0412a08adfe4a00866ec04ffff4a (patch) | |
tree | 0109e95211b084b1623a440eede4d91db400c84b | |
parent | 9fe25bf02dceec04f0ffd6a05cc47146ceab9904 (diff) | |
download | lorry-0830715fd71e0412a08adfe4a00866ec04ffff4a.tar.gz |
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.
-rwxr-xr-x | lorry | 24 |
1 files changed, 13 insertions, 11 deletions
@@ -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) |