@@ -0,0 +1,1104 @@
+import os%0Aimport sys%0A%0A# As this plugin is typically only sym-linked into a gerrit checkout and both os.getcwd and%0A# os.path.abspath follow symbolic links, they would not allow us to find the gerrit root%0A# directory. So we have to resort to the PWD environment variable to find the place we're%0A# symlinked to.%0A#%0A# We append __file__ to avoid having to require to run it from a well-know directory.%0AABS_FILE_PARTS = os.path.join(os.getenv('PWD'), __file__).split(os.sep)%0APLUGIN_NAME = ABS_FILE_PARTS%5B-3%5D%0AGERRIT_ROOT = os.sep.join(ABS_FILE_PARTS%5B:-4%5D)%0A%0Asys.path = %5Bos.sep.join(%5BGERRIT_ROOT, 'tools'%5D)%5D + sys.path%0Afrom workspace_status_release import revision%0A%0Adef get_plugin_revision(name):%0A    os.chdir(os.path.join(GERRIT_ROOT, 'plugins', name))%0A    ret=revision(GERRIT_VERSION)%0A    return ret%0A%0Aos.chdir(GERRIT_ROOT)%0AGERRIT_VERSION=revision()%0A%0AITS_BASE_VERSION=get_plugin_revision('its-base')%0APLUGIN_RAW_VERSION=get_plugin_revision(PLUGIN_NAME)%0A%0APLUGIN_FULL_VERSION=%22%25s(its-base:%25s)%22 %25 (PLUGIN_RAW_VERSION, ITS_BASE_VERSION)%0A%0Aprint(%22STABLE_BUILD_%25s_LABEL %25s%22 %25 (PLUGIN_NAME.upper(), PLUGIN_FULL_VERSION))%0A

Add custom stamp to add its-base revision to version number