Changeset 171856 in webkit


Ignore:
Timestamp:
Jul 31, 2014 9:24:02 AM (10 years ago)
Author:
commit-queue@webkit.org
Message:

[webkitpy] Make diff_text generate correct diff if there is no newline at the end of file
https://bugs.webkit.org/show_bug.cgi?id=135381

Patch by Tibor Meszaros <tmeszaros.u-szeged@partner.samsung.com> on 2014-07-31
Reviewed by Csaba Osztrogonác.

  • Scripts/webkitpy/port/base.py:

(Port.diff_text):

  • Scripts/webkitpy/port/base_unittest.py:

(PortTest.test_diff_text):

Location:
trunk/Tools
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r171848 r171856  
     12014-07-31  Tibor Meszaros  <tmeszaros.u-szeged@partner.samsung.com>
     2
     3        [webkitpy] Make diff_text generate correct diff if there is no newline at the end of file
     4        https://bugs.webkit.org/show_bug.cgi?id=135381
     5
     6        Reviewed by Csaba Osztrogonác.
     7
     8        * Scripts/webkitpy/port/base.py:
     9        (Port.diff_text):
     10        * Scripts/webkitpy/port/base_unittest.py:
     11        (PortTest.test_diff_text):
     12
    1132014-07-31  Carlos Garcia Campos  <cgarcia@igalia.com>
    214
  • trunk/Tools/Scripts/webkitpy/port/base.py

    r170527 r171856  
    314314                                    expected_filename,
    315315                                    actual_filename)
    316         return ''.join(diff)
     316        result = ""
     317        for line in diff:
     318            result += line
     319            if not line.endswith('\n'):
     320                result += '\n\ No newline at end of file\n'
     321        return result
    317322
    318323    def check_for_leaks(self, process_name, process_pid):
  • trunk/Tools/Scripts/webkitpy/port/base_unittest.py

    • Property svn:executable set to *
    r166619 r171856  
    109109            u'a\xac\u1234\u20ac\U00008000', 'act', 'exp.txt', 'act.txt')
    110110
     111        t1 = "A\n\nB"
     112        t2 = "A\n\nB\n\n\n"
     113        t3 = "--- exp.txt\n+++ act.txt\n@@ -1,3 +1,5 @@\n A\n \n-B\n\ No newline at end of file\n+B\n+\n+\n"
     114        self.assertEqual(t3, port.diff_text(t1, t2, 'exp.txt', 'act.txt'))
     115
    111116        # And make sure we actually get diff output.
    112117        diff = port.diff_text('foo', 'bar', 'exp.txt', 'act.txt')
Note: See TracChangeset for help on using the changeset viewer.