]> git.donarmstrong.com Git - lilypond.git/blobdiff - python/auxiliar/buildlib.py
Merge branch 'lilypond/translation' of ssh://git.sv.gnu.org/srv/git/lilypond into...
[lilypond.git] / python / auxiliar / buildlib.py
index cd99586ff81038832afcae4b9c31468cde8766b5..04a72c7924df43b4ed89eb75cab166643b476ff8 100644 (file)
@@ -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: <hash>' 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: <hash>' 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 ()