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

Unified Diff: presubmit_support.py

Issue 113354: Add more presubmit support. Add PRESUBMIT.py to depot_tools.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools/
Patch Set: Created 11 years, 7 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 | « PRESUBMIT.py ('k') | tests/__init__.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: presubmit_support.py
===================================================================
--- presubmit_support.py (revision 15959)
+++ presubmit_support.py (working copy)
@@ -181,7 +181,7 @@
self.platform = sys.platform
# The local path of the currently-being-processed presubmit script.
- self.current_presubmit_path = presubmit_path
+ self._current_presubmit_path = os.path.dirname(presubmit_path)
# We carry the canned checks so presubmit scripts can easily use them.
self.canned_checks = presubmit_canned_checks
@@ -194,7 +194,7 @@
relative to the PRESUBMIT.py script, so the whole tree can be branched and
the presubmit script still works, without editing its content.
"""
- return self.current_presubmit_path
+ return self._current_presubmit_path
@staticmethod
def DepotToLocalPath(depot_path):
@@ -258,8 +258,7 @@
script, or subdirectories thereof.
"""
output_files = []
- dir_with_slash = normpath(
- "%s/" % os.path.dirname(self.current_presubmit_path))
+ dir_with_slash = normpath("%s/" % self.PresubmitLocalPath())
if len(dir_with_slash) == 1:
dir_with_slash = ''
for af in self.change.AffectedFiles(include_dirs, include_deletes):
@@ -630,6 +629,7 @@
results = []
executer = PresubmitExecuter(change_info, committing)
for filename in presubmit_files:
+ filename = os.path.abspath(filename)
if verbose:
print "Running %s" % filename
# Accept CRLF presubmit script.
« no previous file with comments | « PRESUBMIT.py ('k') | tests/__init__.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698