Mercurial > kallithea
changeset 1571:a9888895b60d beta
added quiet flag into get_current_revision
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Mon, 17 Oct 2011 01:48:00 +0200 |
parents | ff41d5f00e28 |
children | 5498f86ba217 e0b069468de0 2c08b6929b1c 51bd5404529c |
files | rhodecode/lib/__init__.py |
diffstat | 1 files changed, 7 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/rhodecode/lib/__init__.py Mon Oct 17 01:40:22 2011 +0200 +++ b/rhodecode/lib/__init__.py Mon Oct 17 01:48:00 2011 +0200 @@ -383,10 +383,12 @@ return cs -def get_current_revision(): +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: @@ -399,6 +401,8 @@ tip = repo.get_changeset() return (tip.revision, tip.short_id) except (ImportError, RepositoryError, VCSError), err: - print ("Cannot retrieve rhodecode's revision. Original error " - "was: %s" % err) + if not quiet: + print ("Cannot retrieve rhodecode's revision. Original error " + "was: %s" % err) return None +