# HG changeset patch # User Marcin Kuzminski # Date 1318808916 -7200 # Node ID 5498f86ba2175fdf87028d2e83d842ad4a6f59be # Parent dddd9380d0bfac69772f6a77a72d70e3db4d78af# Parent a9888895b60d1af2a16fecfe670a3e39327ed290 Merge with a9888895b60d1af2a16fecfe670a3e39327ed290 diff -r dddd9380d0bf -r 5498f86ba217 rhodecode/lib/__init__.py --- a/rhodecode/lib/__init__.py Mon Oct 17 01:42:55 2011 +0200 +++ b/rhodecode/lib/__init__.py Mon Oct 17 01:48:36 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 +