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.abspath(os.path.join(os.path.dirname(__file__),'..','..'))scm=get_scm(repopath)[0]repo=get_repo(path=repopath,alias=scm)wk_dir=repo.workdircur_rev=wk_dir.get_changeset()return(cur_rev.revision,cur_rev.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