Bug 116016 - [webkitpy] Make FileInfo.repository_name support SVN version > 1.6
Summary: [webkitpy] Make FileInfo.repository_name support SVN version > 1.6
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Csaba Osztrogonác
URL:
Keywords:
Depends on:
Blocks: 115567
  Show dependency treegraph
 
Reported: 2013-05-13 01:57 PDT by Csaba Osztrogonác
Modified: 2013-05-13 12:22 PDT (History)
11 users (show)

See Also:


Attachments
Patch (2.15 KB, patch)
2013-05-13 02:47 PDT, Csaba Osztrogonác
dpranke: commit-queue+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Csaba Osztrogonác 2013-05-13 01:57:55 PDT
New webkitpy test introduced in r149635 fails on the buildbots.
It fails only in SVN repositories, but passes in GIT repositories. :)

I started digging it, and it seems the problem is somewhere 
near class FileInfo implementation in cpp.py.

from SVN repository:
---------------------
$ Tools/Scripts/test-webkitpy Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py
Suppressing most webkitpy logging while running unit tests.
[1/1] webkitpy.style.checkers.cpp_unittest.CppStyleTest.test_webcore_platform_layering_violation failed:
  Traceback (most recent call last):
    File "/home/oszi/WebKit-svn/Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py", line 251, in test_webcore_platform_layering_violation
      self.assertEqual(1, error_collector.result_list().count(errmsg))
  AssertionError: 1 != 0

Ran 1 test in 0.023s
FAILED (failures=1, errors=0)

from GIT repository:
---------------------
$ Tools/Scripts/test-webkitpy Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py
Suppressing most webkitpy logging while running unit tests.
Skipping tests in the following modules or packages because they are really, really, slow:
    webkitpy.common.checkout.scm.scm_unittest
    (https://bugs.webkit.org/show_bug.cgi?id=31818; use --all to include)

Ran 1276 tests in 3.063s

OK
Comment 1 Csaba Osztrogonác 2013-05-13 02:09:20 PDT
cpp.py:
----------
def check_for_webcore_platform_layering_violation(filename, clean_lines, line_number, error):
    """Checks for platform-specific code inside WebCore outside of the platform layer."""
    directory = FileInfo(filename).split()[0]
if not match(r'Source/WebCore', directory):
        return
    if match(r'Source/WebCore/platform', directory):
        return


I got the root of the bug. FileInfo(filename).split() returns absolute
path inside SVN repository and relative path inside GIT repository:
- SVN: ('/home/webkitbuildbot/oszi/WebKit-svn/Source/WebCore/loader', 'NavigationAction', '.cpp')
- GIT: ('Source/WebCore/loader', 'NavigationAction', '.cpp')
Comment 2 Csaba Osztrogonác 2013-05-13 02:21:26 PDT
The problem is bigger than I thought before. :-/

The implementation of FileInfo.repository_name is incorrect 
for SVN 1.7, because there isn't .svn directories everywhere, 
only in the root directory.
Comment 3 Csaba Osztrogonác 2013-05-13 02:28:19 PDT
The original implemantation introduced in http://trac.webkit.org/changeset/45857 long long time ago. 

It seems this bug was fixed in the upstream - http://google-styleguide.googlecode.com/svn/trunk/cpplint/cpplint.py
Comment 4 Csaba Osztrogonác 2013-05-13 02:47:54 PDT
Created attachment 201540 [details]
Patch
Comment 5 WebKit Commit Bot 2013-05-13 12:22:38 PDT
Comment on attachment 201540 [details]
Patch

Clearing flags on attachment: 201540

Committed r150028: <http://trac.webkit.org/changeset/150028>
Comment 6 WebKit Commit Bot 2013-05-13 12:22:41 PDT
All reviewed patches have been landed.  Closing bug.