jenkins-bot has submitted this change and it was merged.
Change subject: bug fix and revert for version handling ......................................................................
bug fix and revert for version handling
* git version info extraction was buggy * version handling was messed up by change of __version__ to __initversion__ (use __release__ instead!!)
Change-Id: Ibbf5953bf8759f94323f9d31bded2c3095ba58a0 --- M pywikibot/__init__.py M pywikibot/version.py M scripts/version.py 3 files changed, 7 insertions(+), 6 deletions(-)
Approvals: Legoktm: Looks good to me, approved DrTrigon: Checked; Looks good to me, but someone else must approve jenkins-bot: Verified
diff --git a/pywikibot/__init__.py b/pywikibot/__init__.py index 27c9d52..414550d 100644 --- a/pywikibot/__init__.py +++ b/pywikibot/__init__.py @@ -7,8 +7,8 @@ # # Distributed under the terms of the MIT license. # -__version__ = '2.0b1' -__initversion__ = '$Id$' +__release__ = '2.0b1' +__version__ = '$Id$'
import datetime import difflib diff --git a/pywikibot/version.py b/pywikibot/version.py index 6a8eb92..eb3e22c 100644 --- a/pywikibot/version.py +++ b/pywikibot/version.py @@ -10,8 +10,7 @@ __version__ = '$Id$'
import os -import time -import datetime +import time, datetime import urllib import subprocess
@@ -122,12 +121,14 @@ t = tag.strip().split('/') tag = '[%s] %s' % (t[0][:-1], '/'.join(t[3:])[:-4]) info = subprocess.Popen("git log --pretty=format:'%ad|%an|%h|%H|%d' --abbrev-commit --date=iso -1 | cat -", + cwd=_program_dir, shell=True, stdout=subprocess.PIPE).stdout.read() info = info.split('|') date = info[0][:-6] date = time.strptime(date, '%Y-%m-%d %H:%M:%S') rev = subprocess.Popen('git rev-list HEAD | wc -l', + cwd=_program_dir, shell=True, stdout=subprocess.PIPE).stdout.read() rev = int(rev.strip()) @@ -173,7 +174,7 @@ fn = os.path.join(_program_dir, filename) if os.path.exists(fn): for line in open(fn, 'r').readlines(): - if line.find('__initversion__') == 0: + if line.find('__version__') == 0: exec(line) break stat = os.stat(fn) diff --git a/scripts/version.py b/scripts/version.py index 32b06df..7cb2bc7 100755 --- a/scripts/version.py +++ b/scripts/version.py @@ -17,7 +17,7 @@
if __name__ == '__main__': print 'Pywikibot: %s' % getversion() - print 'Release version: %s' % pywikibot.__version__ + print 'Release version: %s' % pywikibot.__release__ print 'Python: %s' % sys.version #print 'config-settings:' #print 'site_interface =', config.site_interface
pywikibot-commits@lists.wikimedia.org