changeset 1572:5498f86ba217

Merge with a9888895b60d1af2a16fecfe670a3e39327ed290
author Marcin Kuzminski <marcin@python-works.com>
date Mon, 17 Oct 2011 01:48:36 +0200
parents dddd9380d0bf (current diff) a9888895b60d (diff)
children 22273bec00ba
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: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
+