Changeset - 5498f86ba217
[Not reviewed]
Merge default
0 1 0
Marcin Kuzminski - 14 years ago 2011-10-17 01:48:36
marcin@python-works.com
1 file changed with 7 insertions and 3 deletions:
0 comments (0 inline, 0 general)
rhodecode/lib/__init__.py
Show inline comments
 
@@ -383,10 +383,12 @@ def get_changeset_safe(repo, rev):
 
    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 @@ def get_current_revision():
 
        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
 

	
0 comments (0 inline, 0 general)