diff --git a/kallithea/__init__.py b/kallithea/__init__.py --- a/kallithea/__init__.py +++ b/kallithea/__init__.py @@ -54,15 +54,7 @@ else: # Users.extern_type and .extern_name value for local users EXTERN_TYPE_INTERNAL = 'internal' -try: - from kallithea.lib import get_current_revision - _rev = get_current_revision(quiet=True) - if _rev and len(VERSION) > 3: - VERSION += (_rev[0],) -except ImportError: - pass - -__version__ = ('.'.join((str(each) for each in VERSION[:3]))) +__version__ = '.'.join(str(each) for each in VERSION) __dbversion__ = 31 # defines current db version for migrations __platform__ = platform.system() __license__ = 'GPLv3' @@ -73,13 +65,6 @@ __url__ = 'https://kallithea-scm.org/' is_windows = __platform__ in ['Windows'] is_unix = not is_windows -if len(VERSION) > 3: - __version__ += '.'+VERSION[3] - - if len(VERSION) > 4: - __version__ += VERSION[4] - else: - __version__ += '0' # Hack for making the celery dependency kombu==1.5.1 compatible with Python # 2.7.11 which has https://hg.python.org/releases/2.7.11/rev/24bdc4940e81 diff --git a/kallithea/lib/__init__.py b/kallithea/lib/__init__.py --- a/kallithea/lib/__init__.py +++ b/kallithea/lib/__init__.py @@ -24,30 +24,3 @@ Original author and date, and relevant c :copyright: (c) 2013 RhodeCode GmbH, and others. :license: GPLv3, see LICENSE.md for more details. """ - -import os - -def get_current_revision(quiet=False): - """ - Returns tuple of (number, id) from repository containing this package - or None if repository could not be found. - - :param quiet: prints error for fetching revision if True - """ - - try: - from kallithea.lib.vcs import get_repo - from kallithea.lib.vcs.utils.helpers import get_scm - repopath = os.path.abspath(os.path.join(os.path.dirname(__file__), - '..', '..')) - scm = get_scm(repopath)[0] - repo = get_repo(path=repopath, alias=scm) - wk_dir = repo.workdir - cur_rev = wk_dir.get_changeset() - return (cur_rev.revision, cur_rev.short_id) - except Exception as err: - if not quiet: - print ("WARNING: Cannot retrieve kallithea's revision. " - "disregard this if you don't know what that means. " - "Original error was: %s" % err) - return None