Commit 9711bbaf authored by maruel@chromium.org's avatar maruel@chromium.org

Add InputApi.version so the presubmit script can mark a minimum supported version for instance.

BUG=None
R=joi

Review URL: http://codereview.chromium.org/115719

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@16819 0039d316-1c4b-4281-b951-d872f2087c98
parent dbbeedc6
......@@ -6,7 +6,7 @@
"""Enables directory-specific presubmit checks to run at upload and/or commit.
"""
__version__ = '1.0.1'
__version__ = '1.1'
# TODO(joi) Add caching where appropriate/needed. The API is designed to allow
# caching (between all different invocations of presubmit scripts for a given
......@@ -162,6 +162,8 @@ class InputApi(object):
change: A presubmit.GclChange object.
presubmit_path: The path to the presubmit script being processed.
"""
# Version number of the presubmit_support script.
self.version = [int(x) for x in __version__.split('.')]
self.change = change
# We expose various modules and functions as attributes of the input_api
......
......@@ -404,7 +404,7 @@ class InputApiUnittest(PresubmitTestsBase):
'PresubmitLocalPath', 'RightHandSideLines', 'ServerPaths',
'basename', 'cPickle', 'cStringIO', 'canned_checks', 'change',
'marshal', 'os_path', 'pickle', 'platform',
're', 'subprocess', 'tempfile', 'urllib2',
're', 'subprocess', 'tempfile', 'urllib2', 'version',
]
# If this test fails, you should add the relevant test.
self.compareMembers(presubmit.InputApi(None, './.'), members)
......
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