# All configuration values have a default; values that are commented out
# serve to show the default.
-import sys, os, yaml, datetime
+import sys, os, json, datetime, re
+from subprocess import Popen, PIPE
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# |version| and |release|, also used in various other places throughout the
-f = open('../static.yml')
+process = Popen(["hg", "branch"], stdout=PIPE)
+branch = process.communicate().strip()
-v = dataMap['version'].split('.')
+if branch == 'default' or re.match('^\d\.(\d|x)', branch) == None:
+ branch = 'dev-' + branch
+ f = open('../composer.json')
+ if branch in dataMap['extra']['branch-alias']:
+ v = re.split('[.-]', dataMap['extra']['branch-alias'][branch])
[major, minor, bugfix] = v[:3]
-version = major # The short X.Y version.
-release = '.'.join(v[:3]) # The full version, including alpha/beta/rc tags.
+version = major # The short X.Y version.
+release = '.'.join(v[:2]) # The full version, including alpha/beta/rc tags.
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.