From d5bcea3ed9cfb588b24d19c3ef3d92e6433fc0e9 Mon Sep 17 00:00:00 2001 From: Marcio Mazza Date: Mon, 16 Apr 2018 16:17:26 -0300 Subject: [PATCH] Usa git annex --- sapl/legacy/scripts/exporta_zope/exporta_zope.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sapl/legacy/scripts/exporta_zope/exporta_zope.py b/sapl/legacy/scripts/exporta_zope/exporta_zope.py index e27ea974d..ffcbc2d8c 100755 --- a/sapl/legacy/scripts/exporta_zope/exporta_zope.py +++ b/sapl/legacy/scripts/exporta_zope/exporta_zope.py @@ -317,6 +317,10 @@ def _dump_sapl(data_fs_path, destino='../../../../media'): DIR_DADOS_MIGRACAO = Path('~/migracao_sapl/').expand() +def repo_execute(repo, cmd): + return repo.git.execute(cmd.split()) + + def dump_sapl(sigla): data_fs_path = DIR_DADOS_MIGRACAO.child('datafs', 'Data_cm_{}.fs'.format(sigla)) @@ -325,9 +329,10 @@ def dump_sapl(sigla): destino = DIR_DADOS_MIGRACAO.child('repos', nome_banco_legado) destino.mkdir(parents=True) repo = git.Repo.init(destino) - assert not repo.index.diff(None) # o repo não tem mudanças pendentes _dump_sapl(data_fs_path, destino) # grava mundaças + repo_execute(repo, 'git annex init') + repo_execute(repo, 'git annex add sapl_documentos') repo.git.add(A=True) if 'master' not in repo.heads or repo.index.diff('HEAD'): # se de fato existe mudança