diff --git a/presubmit_support.py b/presubmit_support.py index 3ab154987..a7b58c8a1 100755 --- a/presubmit_support.py +++ b/presubmit_support.py @@ -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 diff --git a/tests/presubmit_unittest.py b/tests/presubmit_unittest.py index 1d1a9b490..88b2f71b7 100755 --- a/tests/presubmit_unittest.py +++ b/tests/presubmit_unittest.py @@ -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)