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

Unified Diff: presubmit_support.py

Issue 6004006: Fix path filtering to be on the relative path and no on the absolute path. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: added comment Created 10 years 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 | « presubmit_canned_checks.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: presubmit_support.py
diff --git a/presubmit_support.py b/presubmit_support.py
index 59ae9a7664e78a0bb0319234c37f258fe05e1fbf..79bc306bdcb306be12afca6929d25e0b548e4177 100755
--- a/presubmit_support.py
+++ b/presubmit_support.py
@@ -211,8 +211,8 @@ class InputApi(object):
# All caps files like README and LICENCE.
r".*\b[A-Z0-9_]+$",
# SCM (can happen in dual SCM configuration). (Slightly over aggressive)
- r".*\.git[\\\/].*",
- r".*\.svn[\\\/].*",
+ r"(|.*[\\\/])\.git[\\\/].*",
+ r"(|.*[\\\/])\.svn[\\\/].*",
)
def __init__(self, change, presubmit_path, is_committing):
@@ -405,6 +405,7 @@ class AffectedFile(object):
self._local_root = repository_root
self._is_directory = None
self._properties = {}
+ logging.debug('%s(%s)' % (self.__class__.__name__, self._path))
def ServerPath(self):
"""Returns a path string that identifies the file in the SCM system.
@@ -802,6 +803,7 @@ def ListRelevantPresubmitFiles(files, root):
if os.path.isfile(p):
results.append(p)
+ logging.debug('Presubmit files: %s' % ','.join(results))
return results
@@ -917,7 +919,9 @@ class PresubmitExecuter(object):
function_name = 'CheckChangeOnUpload'
if function_name in context:
context['__args'] = (input_api, OutputApi())
+ logging.debug('Running %s in %s' % (function_name, presubmit_path))
result = eval(function_name + '(*__args)', context)
+ logging.debug('Running %s done.' % function_name)
if not (isinstance(result, types.TupleType) or
isinstance(result, types.ListType)):
raise exceptions.RuntimeError(
« no previous file with comments | « presubmit_canned_checks.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698