diff options
Diffstat (limited to 'lorry')
-rwxr-xr-x | lorry | 16 |
1 files changed, 13 insertions, 3 deletions
@@ -189,11 +189,17 @@ class Lorry(cliapp.Application): gitdir = os.path.join(dirname, 'git') backupdir = self.backup_gitdir(name, dirname, gitdir) try: + self.needs_aggressive = False table[vcstype](name, dirname, gitdir, spec) if self.settings['repack']: self.progress('.. repacking %s git repository' % name) - self.run_program(['git', 'repack', '-a', '-d', '--depth=250', - '--window=250'], cwd=gitdir) + self.run_program(['git', 'config', + 'pack.windowMemory', '128M'], cwd=gitdir) + args = ['git', 'gc'] + if self.needs_aggressive: + args += ['--aggressive'] + self.run_program(args, cwd=gitdir) + self.bundle(name, gitdir) self.make_tarball(name, gitdir) except: @@ -294,6 +300,7 @@ class Lorry(cliapp.Application): self.progress('.. creating git repo') os.mkdir(gitdir) self.run_program(['git', 'init', '--bare', gitdir]) + self.needs_aggressive = True # branches are the listed branches, plus the branch specified in url if 'branches' in spec: @@ -348,7 +355,7 @@ class Lorry(cliapp.Application): def gitify_svn(self, project_name, dirname, gitdir, spec): if not os.path.exists(gitdir): self.progress('.. doing initial clone') - os.mkdir(gitdir) + self.needs_aggressive = True layout = spec["layout"] # if standard layour specified, fill in the defaults if layout == "standard": @@ -381,6 +388,7 @@ class Lorry(cliapp.Application): self.run_program(['git', 'svn', 'fetch'], cwd=gitdir) def gitify_cvs(self, project_name, dirname, gitdir, spec): + self.needs_aggressive = True self.run_program(['git', 'cvsimport', '-a', '-d', spec['url'], '-C', gitdir, spec['module']]) @@ -394,6 +402,7 @@ class Lorry(cliapp.Application): self.run_program(['hg', 'clone', '--quiet', spec['url'], hgdir]) if not os.path.exists(gitdir): + self.needs_aggressive = True self.run_program(['git', 'init', '--bare', gitdir]) self.progress('.. fast-exporting into git') @@ -418,6 +427,7 @@ class Lorry(cliapp.Application): self.run_program(['git', 'init', '--bare', gitdir]) cmdline = ["%s.tar-importer" % __file__, tardest] self.run_program(cmdline, cwd=gitdir) + self.needs_aggressive = True def push_to_mirror_server(self, name, gitdir, |