Mercurial > kallithea
comparison 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 |
comparison
equal
deleted
inserted
replaced
3879:51596d9ef2f8 | 3960:5293d4bbb1ea |
---|---|
10 """ | 10 """ |
11 | 11 |
12 try: | 12 try: |
13 from rhodecode.lib.vcs import get_repo | 13 from rhodecode.lib.vcs import get_repo |
14 from rhodecode.lib.vcs.utils.helpers import get_scm | 14 from rhodecode.lib.vcs.utils.helpers import get_scm |
15 repopath = os.path.join(os.path.dirname(__file__), '..', '..') | 15 repopath = os.path.abspath(os.path.join(os.path.dirname(__file__), |
16 '..', '..')) | |
16 scm = get_scm(repopath)[0] | 17 scm = get_scm(repopath)[0] |
17 repo = get_repo(path=repopath, alias=scm) | 18 repo = get_repo(path=repopath, alias=scm) |
18 tip = repo.get_changeset() | 19 wk_dir = repo.workdir |
19 return (tip.revision, tip.short_id) | 20 cur_rev = wk_dir.get_changeset() |
21 return (cur_rev.revision, cur_rev.short_id) | |
20 except Exception, err: | 22 except Exception, err: |
21 if not quiet: | 23 if not quiet: |
22 print ("WARNING: Cannot retrieve rhodecode's revision. " | 24 print ("WARNING: Cannot retrieve rhodecode's revision. " |
23 "disregard this if you don't know what that means. " | 25 "disregard this if you don't know what that means. " |
24 "Original error was: %s" % err) | 26 "Original error was: %s" % err) |