Commit d0adba81 authored by Michal Čihař's avatar Michal Čihař

Merge pull request #655 from madmuffin1/master

Basic Gerrit Support
parents 63ac6c58 29052a8f
......@@ -19,7 +19,8 @@
#
from weblate.trans.tests.test_models import RepoTestCase
from weblate.trans.vcs import GitRepository, HgRepository, RepositoryException
from weblate.trans.vcs import GitRepository, HgRepository, \
RepositoryException, GitWithGerritRepository
import tempfile
import shutil
......@@ -228,6 +229,12 @@ class VCSGitTest(RepoTestCase):
)
class VCSGerritTest(VCSGitTest):
_class = GitWithGerritRepository
_vcs = 'git'
_branch = 'master'
class VCSHgTest(VCSGitTest):
"""
Mercurial repository testing.
......
......@@ -606,6 +606,21 @@ class GitRepository(Repository):
return self.execute(['describe', '--always']).strip()
@register_vcs
class GitWithGerritRepository(GitRepository):
name = 'Gerrit'
def push(self, branch):
try:
self.execute(['review'])
except RepositoryException as error:
if error.retcode == 1:
# Nothing to push
return
raise
@register_vcs
class HgRepository(Repository):
"""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment