diff options
| author | Christophe Simonis <chs@tinyerp.com> | 2008-09-13 00:04:19 +0200 |
|---|---|---|
| committer | Christophe Simonis <chs@tinyerp.com> | 2008-09-13 00:04:19 +0200 |
| commit | fc38900f6f567e800a97b75ae7cb7823a7040f33 (patch) | |
| tree | 7fee72b383a2db326607e35e39f5c25836b9212a /bin/release.py | |
| parent | 941c7666875f9a890007858674c3d22ff605e88a (diff) | |
version content the bzr revno if available
bzr revid: chs@tinyerp.com-20080912220419-g5sgbxh9m9gdcktq
Diffstat (limited to 'bin/release.py')
| -rw-r--r-- | bin/release.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/bin/release.py b/bin/release.py index 5ef7b184ee0..f53fdc05035 100644 --- a/bin/release.py +++ b/bin/release.py @@ -49,5 +49,22 @@ author_email = 'info@tiny.be' support_email = 'support@openerp.com' license = 'GPL-2' +try: + # if the sources are taken from the bzr repository, + # append the revision number and the date of the bzr branch + from bzrlib.branch import Branch + from bzrlib.osutils import format_date + try: + from os.path import dirname + _branch = Branch.open(dirname(dirname(__file__))) + _lastrev = _branch.repository.get_revision(_branch.last_revision()) + _date = format_date(_lastrev.timestamp, _lastrev.timezone) + version = "%s~bzr-%s (%s)" % (version, _branch.revno(), _date) + except: + # This is not because bzr is installed that openerp is under revision. + pass +except ImportError: + pass + # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
