1. Lester Peabody
  2. RhodeCode

Commits

Marcin Kuzminski  committed a988889

added quiet flag into get_current_revision

  • Participants
  • Parent commits ff41d5f
  • Branches beta

Comments (0)

Files changed (1)

File rhodecode/lib/__init__.py

View file
  • Ignore whitespace
     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:
         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
+