Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Unified Diff: gcl.py

Issue 340030: Revise change in r30415 to properly climb local directories looking for a ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/tools/depot_tools/
Patch Set: Created 11 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gcl.py
===================================================================
--- gcl.py (revision 30415)
+++ gcl.py (working copy)
@@ -145,6 +145,8 @@
return None
if (not os.path.exists(cached_file) or
os.stat(cached_file).st_mtime > max_age):
+ local_dir = os.path.dirname(os.path.abspath(filename))
+ local_base = os.path.basename(filename)
dir_info = gclient_scm.CaptureSVNInfo(".")
repo_root = dir_info["Repository Root"]
if use_root:
@@ -153,13 +155,14 @@
url_path = dir_info["URL"]
content = ""
while True:
- # First, look for a locally modified version of codereview.settings.
- content, rc = RunShellWithReturnCode(["svn", "status", filename])
+ # First, look for a locally modified version of the file.
+ local_path = os.path.join(local_dir, local_base)
+ content, rc = RunShellWithReturnCode(["svn", "status", local_path])
if not rc and content.startswith('M'):
- content = ReadFile(filename)
+ content = ReadFile(local_path)
rc = 0
else:
- # Then look in the repository
+ # Then look in the repository.
svn_path = url_path + "/" + filename
content, rc = RunShellWithReturnCode(["svn", "cat", svn_path])
@@ -173,6 +176,7 @@
break
# Go up one level to try again.
url_path = os.path.dirname(url_path)
+ local_dir = os.path.dirname(local_dir)
# Write a cached version even if there isn't a file, so we don't try to
# fetch it each time.
WriteFile(cached_file, content)
@@ -1080,12 +1084,9 @@
if change_info.MissingTests():
Warn("WARNING: " + MISSING_TEST_MSG)
-# We don't lint files in these path prefixes.
-IGNORE_PATHS = (os.path.join("webkit","api"),)
-
# Valid extensions for files we want to lint.
-LINT_REGEX = r"(.*\.cpp|.*\.cc|.*\.h)"
-LINT_IGNORE_REGEX = r""
+DEFAULT_LINT_REGEX = r"(.*\.cpp|.*\.cc|.*\.h)"
+DEFAULT_LINT_IGNORE_REGEX = r""
def Lint(change_info, args):
"""Runs cpplint.py on all the files in |change_info|"""
@@ -1104,11 +1105,11 @@
white_list = GetCodeReviewSetting("LINT_REGEX")
if not white_list:
- white_list = LINT_REGEX
+ white_list = DEFAULT_LINT_REGEX
white_regex = re.compile(white_list)
black_list = GetCodeReviewSetting("LINT_IGNORE_REGEX")
if not black_list:
- black_list = LINT_IGNORE_REGEX
+ black_list = DEFAULT_LINT_IGNORE_REGEX
black_regex = re.compile(black_list)
for file in filenames:
if white_regex.match(file):
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698