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

Fix merge/rebase abort

Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent 07f512ff
...@@ -692,7 +692,7 @@ class SubProject(models.Model, PercentMixin, URLMixin, PathMixin): ...@@ -692,7 +692,7 @@ class SubProject(models.Model, PercentMixin, URLMixin, PathMixin):
# In case merge has failer recover # In case merge has failer recover
status = self.repository.status() status = self.repository.status()
error = str(error) error = str(error)
method('--abort') method(abort=True)
# Log error # Log error
weblate.logger.warning( weblate.logger.warning(
......
...@@ -126,13 +126,13 @@ class Repository(object): ...@@ -126,13 +126,13 @@ class Repository(object):
""" """
raise NotImplementedError() raise NotImplementedError()
def merge(self, branch): def merge(self, branch=None, abort=False):
""" """
Merges remote branch into working copy. Merges remote branch into working copy.
""" """
raise NotImplementedError() raise NotImplementedError()
def rebase(self, branch): def rebase(self, branch=None, abort=False):
""" """
Rebases working copy on top of remote branch. Rebases working copy on top of remote branch.
""" """
...@@ -268,17 +268,23 @@ class GitRepository(Repository): ...@@ -268,17 +268,23 @@ class GitRepository(Repository):
""" """
self.execute(['reset', '--hard', 'origin/{0}'.format(branch)]) self.execute(['reset', '--hard', 'origin/{0}'.format(branch)])
def rebase(self, branch): def rebase(self, branch=None, abort=False):
""" """
Rebases working copy on top of remote branch. Rebases working copy on top of remote branch.
""" """
self.execute(['rebase', 'origin/{0}'.format(branch)]) if abort:
self.execute(['rebase', '--abort'])
else:
self.execute(['rebase', 'origin/{0}'.format(branch)])
def merge(self, branch): def merge(self, branch=None, abort=False):
""" """
Resets working copy to match remote branch. Resets working copy to match remote branch.
""" """
self.execute(['merge', 'origin/{0}'.format(branch)]) if abort:
self.execute(['merge', '--abort'])
else:
self.execute(['merge', 'origin/{0}'.format(branch)])
def needs_commit(self, filename=None): def needs_commit(self, filename=None):
""" """
......
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