The branch, master, has been updated.

- Log -----------------------------------------------------------------

commit 4ff3e14144d51b1214fd2eaa343e1f59b310a8b6
Author: Kornel Benko <[email protected]>
Date:   Tue Jan 1 13:23:24 2013 +0100

    In tex2lyx tests do not compare the first 2 lines.
    This removes the need to update the lyx-format of the test files too often.
    (To please Vincent and me)

diff --git a/src/tex2lyx/test/runtests.py b/src/tex2lyx/test/runtests.py
index 1ae90de..b1383cd 100755
--- a/src/tex2lyx/test/runtests.py
+++ b/src/tex2lyx/test/runtests.py
@@ -90,18 +90,23 @@ def main(argv):
                           os.path.join(outputdir, base + ".lyx2.lyx"), 
uselyx2lyx)
                 if lyxfile2 is None:
                     errors.append(f)
-                elif not filecmp.cmp(lyxfile1, lyxfile2, False):
+                else:
                     t1 = time.ctime(os.path.getmtime(lyxfile1))
                     t2 = time.ctime(os.path.getmtime(lyxfile2))
                     f1 = open(lyxfile1, 'r')
                     f2 = open(lyxfile2, 'r')
                     lines1 = f1.readlines()
                     lines2 = f2.readlines()
-                    diff = difflib.unified_diff(lines1, lines2, lyxfile1, 
lyxfile2, t1, t2)
                     f1.close()
                     f2.close()
-                    sys.stdout.writelines(diff)
-                    errors.append(f)
+                   # ignore the first 2 lines
+                   # e.g. '#LyX file created ...'
+                   #      '\lyxformat ...'
+                   if lines1[2:] != lines2[2:]:
+                       sys.stdout.writelines("lines1 != lines2")
+                       diff = difflib.unified_diff(lines1, lines2, lyxfile1, 
lyxfile2, t1, t2)
+                       sys.stdout.writelines(diff)
+                       errors.append(f)
 
     if len(errors) > 0:
         error('Converting the following files failed: %s' % ', '.join(errors))

-----------------------------------------------------------------------

Summary of changes:
 src/tex2lyx/test/runtests.py |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)


hooks/post-receive
-- 
The LyX Source Repository

Reply via email to