1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright © 2007 Kaufmann Manuel <humitos@gmail.com>
#
# 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 <proyect-name> [<proyect-name> ...]"
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!"
|