+
+ merge_branch = 'wl-locale-merge'
+ last_branch = None
+
+ def merge_setup(self, directory):
+ self.last_branch = self.current_branch()
+ rev = open(os.path.join(directory, '.revision')).read()
+
+ self.system('git checkout -b %s %s' % (self.merge_branch, rev))
+
+ def merge_finish(self, message):
+ self.system('git commit -a -m "%s"' % message.replace('"', '\\"'))
+ self.system('git checkout %s' % self.last_branch)
+ self.system('git merge -s recursive -X theirs %s' % self.merge_branch)
+ self.system('git branch -d %s' % self.merge_branch)
+
+ def system(self, fmt, *args):
+ code = os.system(fmt % args)
+ if code != 0:
+ raise OSError('Command %s returned with exit code %d' % (fmt % args, code))
+ return code