importosdefget_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:fromrhodecode.lib.vcsimportget_repofromrhodecode.lib.vcs.utils.helpersimportget_scmrepopath=os.path.join(os.path.dirname(__file__),'..','..')scm=get_scm(repopath)[0]repo=get_repo(path=repopath,alias=scm)tip=repo.get_changeset()return(tip.revision,tip.short_id)exceptException,err:ifnotquiet:print("WARNING: Cannot retrieve rhodecode's revision. ""disregard this if you don't know what that means. ""Original error was: %s"%err)returnNone