diff rhodecode/lib/__init__.py @ 3960:5293d4bbb1ea

Merged dev into stable/default/master branch
author Marcin Kuzminski <marcin@python-works.com>
date Fri, 07 Jun 2013 00:31:11 +0200
parents 3563bb7b4b82 d7488551578e
children ffd45b185016
line wrap: on
line diff
--- a/rhodecode/lib/__init__.py	Mon May 20 12:26:09 2013 +0200
+++ b/rhodecode/lib/__init__.py	Fri Jun 07 00:31:11 2013 +0200
@@ -12,11 +12,13 @@
     try:
         from rhodecode.lib.vcs import get_repo
         from rhodecode.lib.vcs.utils.helpers import get_scm
-        repopath = os.path.join(os.path.dirname(__file__), '..', '..')
+        repopath = os.path.abspath(os.path.join(os.path.dirname(__file__),
+                                                '..', '..'))
         scm = get_scm(repopath)[0]
         repo = get_repo(path=repopath, alias=scm)
-        tip = repo.get_changeset()
-        return (tip.revision, tip.short_id)
+        wk_dir = repo.workdir
+        cur_rev = wk_dir.get_changeset()
+        return (cur_rev.revision, cur_rev.short_id)
     except Exception, err:
         if not quiet:
             print ("WARNING: Cannot retrieve rhodecode's revision. "