mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 18:24:30 -04:00
...
This commit is contained in:
parent
214643208d
commit
34ea3a00a8
@ -227,10 +227,22 @@ class GetTranslations(Translations): # {{{
|
|||||||
ans.append(line.split()[-1])
|
ans.append(line.split()[-1])
|
||||||
return ans
|
return ans
|
||||||
|
|
||||||
|
def resolve_conflicts(self):
|
||||||
|
conflict = False
|
||||||
|
for line in subprocess.check_output(['bzr', 'status']).splitlines():
|
||||||
|
if line == 'conflicts:':
|
||||||
|
conflict = True
|
||||||
|
break
|
||||||
|
if not conflict:
|
||||||
|
raise Exception('bzr merge failed and no conflicts found')
|
||||||
|
subprocess.check_call(['bzr', 'resolve', '--take-other'])
|
||||||
|
|
||||||
def run(self, opts):
|
def run(self, opts):
|
||||||
if not self.modified_translations:
|
if not self.modified_translations:
|
||||||
subprocess.check_call(['bzr', 'merge', self.BRANCH])
|
try:
|
||||||
subprocess.check_call(['bzr', 'resolve', '--take-other'])
|
subprocess.check_call(['bzr', 'merge', self.BRANCH])
|
||||||
|
except subprocess.CalledProcessError:
|
||||||
|
self.resolve_conflicts()
|
||||||
self.check_for_errors()
|
self.check_for_errors()
|
||||||
|
|
||||||
if self.modified_translations:
|
if self.modified_translations:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user