comparison rhodecode/lib/__init__.py @ 1639:95c3e33ef32e

merged upto rev 019026a8cf67
author Marcin Kuzminski <marcin@python-works.com>
date Wed, 02 Nov 2011 22:19:47 +0200
parents 5498f86ba217 67168195a676
children cd1c21af123a
comparison
equal deleted inserted replaced
1637:974d6193b61a 1639:95c3e33ef32e
392 """ 392 """
393 393
394 try: 394 try:
395 from vcs import get_repo 395 from vcs import get_repo
396 from vcs.utils.helpers import get_scm 396 from vcs.utils.helpers import get_scm
397 from vcs.exceptions import RepositoryError, VCSError
398 repopath = os.path.join(os.path.dirname(__file__), '..', '..') 397 repopath = os.path.join(os.path.dirname(__file__), '..', '..')
399 scm = get_scm(repopath)[0] 398 scm = get_scm(repopath)[0]
400 repo = get_repo(path=repopath, alias=scm) 399 repo = get_repo(path=repopath, alias=scm)
401 tip = repo.get_changeset() 400 tip = repo.get_changeset()
402 return (tip.revision, tip.short_id) 401 return (tip.revision, tip.short_id)
403 except (ImportError, RepositoryError, VCSError), err: 402 except Exception, err:
404 if not quiet: 403 if not quiet:
405 print ("Cannot retrieve rhodecode's revision. Original error " 404 print ("Cannot retrieve rhodecode's revision. Original error "
406 "was: %s" % err) 405 "was: %s" % err)
407 return None 406 return None
408 407