#NEWLINE# def get_version( ) : #NEWLINE# #INDENT# 'Returns the version as a human-format string.' #NEWLINE# version = ( '%d.%d.%d' % version_info [ : 3 ] ) #NEWLINE# if ( version_info [ 3 ] != 'f' ) : #NEWLINE# #INDENT# import os #NEWLINE# version = ( '%d.%d.%d%s%d' % version_info ) #NEWLINE# dir = os . path . abspath ( os . path . dirname ( __file__ ) ) #NEWLINE# hg_dir = os . path . normpath ( os . path . join ( dir , '../' ) ) #NEWLINE# if os . path . isdir ( os . path . join ( hg_dir , '.hg' ) ) : #NEWLINE# #INDENT# hg_rev = 'dev0' #NEWLINE# try : #NEWLINE# #INDENT# from mercurial import ui , hg , error #NEWLINE# #UNINDENT# except ImportError : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# repo = hg . repository ( ui . ui ( ) , hg_dir ) #NEWLINE# c = repo [ 'tip' ] #NEWLINE# hg_rev = ( 'dev%s' % c . rev ( ) ) #NEWLINE# #UNINDENT# except error . RepoError : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# #UNINDENT# version = ( '%s.%s' % ( version , dir ) ) #NEWLINE# #UNINDENT# #UNINDENT# return version