#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright © 2007 Kaufmann Manuel # # svn-dump-google is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # svn-dump-google is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with svn-dump-google; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 # USA import os import sys def descargar_repositorio(nombre): comando = "svk mirror //local http://%s.googlecode.com/svn/" % nombre print comando os.system(comando) def sincronizar_repositorio(): comando = "svk sync //local" print comando os.system(comando) def svnadmin_dump_repositorio(nombre): comando = "svnadmin dump -r2:HEAD ~/.svk/local/mirror > %s.svn.repository" % nombre print comando os.system(comando) def borrar_svk(): comando = "rm -rf ~/.svk" print comando os.system(comando) if __name__ == "__main__": #print sys.argv #print len(sys.argv) if len(sys.argv) < 2: print "Usar:\n python .py [ ...]" else: proyectos = sys.argv[1:] print proyectos borrar_svk() for nombre in proyectos: descargar_repositorio(nombre) sincronizar_repositorio() svnadmin_dump_repositorio(nombre) borrar_svk() print "Finalizado!"