from gbp.git.repository import GitRepository
import gbp.log as log
+class GitError(Exception):
+ """Local error handler"""
+ pass
+
class Git(GitRepository):
"""The Git class wrappered from GitRepository"""
GitRepository.__init__(self, path)
log.setup('auto', log.DEBUG)
- def _git_getoutput(self, command, args=[], extra_env=None, cwd=None):
- outs, ret = GitRepository._git_getoutput(self, command, args,
+ def _git_getoutput(self, command, args=(), extra_env=None, cwd=None):
+ outs, ret = GitRepository._git_getoutput(self, command, list(args),
extra_env, cwd)
print '%s outputs: %s' % (command, outs)
return outs, ret
if runner.show(gitcmd)[0] != 0:
result = False
- except Exception, ex:
+ except GitError, ger:
result = False
print '\nExcept occur when clone gerrit project'
- print ex
+ print ger
if not result:
print '\nClone gerrit project Failed.'