Commit a3aedf12 authored by ossy@webkit.org's avatar ossy@webkit.org

[webkitpy] Make FileInfo.repository_name support SVN version > 1.6

https://bugs.webkit.org/show_bug.cgi?id=116016

Reviewed by Dirk Pranke.

Same fix as in the upstream style checker, but without hg support.
( http://google-styleguide.googlecode.com/svn/trunk/cpplint/cpplint.py )

* Scripts/webkitpy/style/checkers/cpp.py:
(FileInfo.repository_name):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150028 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent bd3dabd7
2013-05-13 Csaba Osztrogonác <ossy@webkit.org>
[webkitpy] Make FileInfo.repository_name support SVN version > 1.6
https://bugs.webkit.org/show_bug.cgi?id=116016
Reviewed by Dirk Pranke.
Same fix as in the upstream style checker, but without hg support.
( http://google-styleguide.googlecode.com/svn/trunk/cpplint/cpplint.py )
* Scripts/webkitpy/style/checkers/cpp.py:
(FileInfo.repository_name):
2013-05-13 Zan Dobersek <zdobersek@igalia.com>
[GTK] Use WebCore layer archives for TestWebCore, WebKitPluginProcess
......
......@@ -648,13 +648,16 @@ class FileInfo:
prefix = os.path.commonprefix([root_dir, project_dir])
return fullname[len(prefix) + 1:]
# Not SVN? Try to find a git top level directory by
# Not SVN <= 1.6? Try to find a git, or svn top level directory by
# searching up from the current path.
root_dir = os.path.dirname(fullname)
while (root_dir != os.path.dirname(root_dir)
and not os.path.exists(os.path.join(root_dir, ".git"))):
and not os.path.exists(os.path.join(root_dir, ".git"))
and not os.path.exists(os.path.join(root_dir, ".svn"))):
root_dir = os.path.dirname(root_dir)
if os.path.exists(os.path.join(root_dir, ".git")):
if (os.path.exists(os.path.join(root_dir, ".git")) or
os.path.exists(os.path.join(root_dir, ".svn"))):
prefix = os.path.commonprefix([root_dir, project_dir])
return fullname[len(prefix) + 1:]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment