This commit is contained in:
Kovid Goyal 2013-01-03 16:47:14 +05:30
parent 214643208d
commit 34ea3a00a8

View File

@ -227,10 +227,22 @@ class GetTranslations(Translations): # {{{
ans.append(line.split()[-1])
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):
if not self.modified_translations:
try:
subprocess.check_call(['bzr', 'merge', self.BRANCH])
subprocess.check_call(['bzr', 'resolve', '--take-other'])
except subprocess.CalledProcessError:
self.resolve_conflicts()
self.check_for_errors()
if self.modified_translations: