X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=python%2Fauxiliar%2Fbuildlib.py;h=04a72c7924df43b4ed89eb75cab166643b476ff8;hb=794dcbdb52faf4292036cd1b0270a956cf4316a3;hp=cd99586ff81038832afcae4b9c31468cde8766b5;hpb=38d7d319eabc906e82fb42002678c6d42a23b6f7;p=lilypond.git diff --git a/python/auxiliar/buildlib.py b/python/auxiliar/buildlib.py index cd99586ff8..04a72c7924 100644 --- a/python/auxiliar/buildlib.py +++ b/python/auxiliar/buildlib.py @@ -20,20 +20,22 @@ def read_pipe (command): return (output, error) revision_re = re.compile ('GIT [Cc]ommittish:\s+([a-f0-9]+)') -vc_diff_cmd = 'git diff %(color_flag)s %(revision)s HEAD -- %(original)s | cat' +vc_diff_cmd = 'git diff --patience -M %(color_flag)s %(revision)s %(upper_revision)s -- %(original)s | cat' +no_committish_fatal_error = """error: %s: no 'GIT committish: ' found. +Please check the whole file against the original in English, then +fill in HEAD committish in the header. +""" -def check_translated_doc (original, translated_file, translated_contents, color=False): +def check_translated_doc (original, translated_file, translated_contents, + color=False, upper_revision='HEAD'): m = revision_re.search (translated_contents) if not m: - sys.stderr.write ('error: ' + translated_file + \ - ": no 'GIT committish: ' found.\nPlease check " + \ - 'the whole file against the original in English, then ' + \ - 'fill in HEAD committish in the header.\n') + sys.stderr.write (no_committish_fatal_error % translated_file) sys.exit (1) revision = m.group (1) if color: - color_flag = '--color' + color_flag = '--color --color-words' else: color_flag = '--no-color' c = vc_diff_cmd % vars ()