# HG changeset patch # User Marcin Kuzminski # Date 1318808880 -7200 # Node ID a9888895b60d1af2a16fecfe670a3e39327ed290 # Parent ff41d5f00e28d296303e39f29125e83a01157330 added quiet flag into get_current_revision diff -r ff41d5f00e28 -r a9888895b60d rhodecode/lib/__init__.py --- 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 +