diff options
author | Richard Maw <richard.maw@codethink.co.uk> | 2012-05-24 12:23:40 +0100 |
---|---|---|
committer | Richard Maw <richard.maw@codethink.co.uk> | 2012-05-24 12:23:40 +0100 |
commit | 64546867e445b52a5554ccf1c7e507eeb2ddf4d4 (patch) | |
tree | 8a27aa5967f6e6e350c6331318d5c69b1cc88531 /lorry | |
parent | 2493ff32f7a04e2558da555fdbae38d527e00b60 (diff) | |
download | lorry-64546867e445b52a5554ccf1c7e507eeb2ddf4d4.tar.gz |
lorry: fix url generation
Obviously pushing to the base-url won't work, the repository's
url needs to be generated.
Diffstat (limited to 'lorry')
-rwxr-xr-x | lorry | 18 |
1 files changed, 8 insertions, 10 deletions
@@ -170,9 +170,9 @@ class Lorry(cliapp.Application): if not self.settings['pull-only']: if 'refspecs' in spec: - self.push_to_mirror_server(gitdir, spec['refspecs']) + self.push_to_mirror_server(name, gitdir, spec['refspecs']) else: - self.push_to_mirror_server(gitdir) + self.push_to_mirror_server(name, gitdir) if backupdir is not None: self.progress('.. removing %s git repository backup' % name) @@ -382,14 +382,12 @@ class Lorry(cliapp.Application): cwd=gitdir) - def push_to_mirror_server(self, gitdir, pushrefspecs=[ - 'refs/heads/*:refs/heads/*', - 'refs/tags/*:refs/tags/*']): - self.progress('.. pushing to mirror server %s' % - self.settings['mirror-base-url-push']) - self.run_program(['git', 'push', - self.settings['mirror-base-url-push']]+pushrefspecs, - cwd=gitdir) + def push_to_mirror_server(self, name, gitdir, + pushrefspecs=['refs/heads/*:refs/heads/*', + 'refs/tags/*:refs/tags/*']): + pushurl = "%s/%s.git" % (self.settings['mirror-base-url-push'], name) + self.progress('.. pushing %s to mirror server %s' % (name, pushurl)) + self.run_program(['git', 'push', pushurl]+pushrefspecs, cwd=gitdir) def run_program(self, argv, **kwargs): if self.settings['command-stdout']: |