From c9964a12f513b80ae15a3ff57bb0cda01769fbfa Mon Sep 17 00:00:00 2001 From: ZyX Date: Sun, 30 Nov 2014 03:46:30 +0300 Subject: [PATCH] Use `git mergetool` after error because `-c merge.tool` does not work --- scripts/powerline-release.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/powerline-release.py b/scripts/powerline-release.py index 39b1abc5..e916e74d 100755 --- a/scripts/powerline-release.py +++ b/scripts/powerline-release.py @@ -7,7 +7,7 @@ import codecs import os import re -from subprocess import check_output, check_call +from subprocess import check_output, check_call, CalledProcessError from getpass import getpass from github import Github @@ -50,7 +50,10 @@ def parse_version(s): def merge(version_string, rev, **kwargs): check_call(['git', 'checkout', 'master']) - check_call(['git', '-c', 'merge.tool=vimdiff', 'merge', '--no-ff', '--no-commit', '--log', rev]) + try: + check_call(['git', 'merge', '--no-ff', '--no-commit', '--log', rev]) + except CalledProcessError: + check_call(['git', 'mergetool', '--tool', 'vimdiff2']) with codecs.open('.setup.py.new', 'w', encoding='utf-8') as NS: with codecs.open('setup.py', 'r', encoding='utf-8') as OS: