##// END OF EJS Templates
added quiet flag into get_current_revision
marcink -
r1571:a9888895 beta
parent child Browse files
Show More
@@ -383,10 +383,12 b' def get_changeset_safe(repo, rev):'
383 return cs
383 return cs
384
384
385
385
386 def get_current_revision():
386 def get_current_revision(quiet=False):
387 """
387 """
388 Returns tuple of (number, id) from repository containing this package
388 Returns tuple of (number, id) from repository containing this package
389 or None if repository could not be found.
389 or None if repository could not be found.
390
391 :param quiet: prints error for fetching revision if True
390 """
392 """
391
393
392 try:
394 try:
@@ -399,6 +401,8 b' def get_current_revision():'
399 tip = repo.get_changeset()
401 tip = repo.get_changeset()
400 return (tip.revision, tip.short_id)
402 return (tip.revision, tip.short_id)
401 except (ImportError, RepositoryError, VCSError), err:
403 except (ImportError, RepositoryError, VCSError), err:
402 print ("Cannot retrieve rhodecode's revision. Original error "
404 if not quiet:
403 "was: %s" % err)
405 print ("Cannot retrieve rhodecode's revision. Original error "
406 "was: %s" % err)
404 return None
407 return None
408
General Comments 0
You need to be logged in to leave comments. Login now