From 2b75ba29e2dd713d1e78ea020a2e1000fcbc0c1d Mon Sep 17 00:00:00 2001 From: Goran Cetusic Date: Wed, 11 Sep 2013 16:50:23 +0200 Subject: [PATCH 1/2] just use the repository c3po is called with and override the existing setting --- c3po/mod/communicator.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/c3po/mod/communicator.py b/c3po/mod/communicator.py index 65209db..d8d3943 100644 --- a/c3po/mod/communicator.py +++ b/c3po/mod/communicator.py @@ -264,11 +264,12 @@ def git_push(git_message=None, git_repository=None, git_branch=None, locale_root raise PODocsError(e) try: - subprocess.check_call(['git', 'ls-remote', git_repository]) - except subprocess.CalledProcessError: + subprocess.check_call(['git', 'remote', 'add', 'po_translator', git_repository]) + except subprocess.CalledProcessError as e: try: + subprocess.check_call(['git', 'remote', 'rm', 'po_translator']) subprocess.check_call(['git', 'remote', 'add', 'po_translator', git_repository]) - except subprocess.CalledProcessError as e: + except: raise PODocsError(e) commands = 'git add ' + locale_root + \ From aafccbab49595b9760b00b625adef4720d3fcc25 Mon Sep 17 00:00:00 2001 From: Goran Cetusic Date: Wed, 11 Sep 2013 17:00:15 +0200 Subject: [PATCH 2/2] fixed exception handling --- c3po/mod/communicator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/c3po/mod/communicator.py b/c3po/mod/communicator.py index d8d3943..2a9fdd0 100644 --- a/c3po/mod/communicator.py +++ b/c3po/mod/communicator.py @@ -269,7 +269,7 @@ def git_push(git_message=None, git_repository=None, git_branch=None, locale_root try: subprocess.check_call(['git', 'remote', 'rm', 'po_translator']) subprocess.check_call(['git', 'remote', 'add', 'po_translator', git_repository]) - except: + except subprocess.CalledProcessError as e: raise PODocsError(e) commands = 'git add ' + locale_root + \