#NEWLINE# def get_status( self , basepath = None , untracked = False ) : #NEWLINE# #INDENT# response = None #NEWLINE# if ( basepath is None ) : #NEWLINE# #INDENT# basepath = self . _path #NEWLINE# #UNINDENT# if self . path_exists ( ) : #NEWLINE# #INDENT# rel_path = normalized_rel_path ( self . _path , basepath ) #NEWLINE# command = ( 'hg status %(path)s --repository %(path)s' % { #NEWLINE# #INDENT# 'path' : sanitized ( rel_path ) , #NEWLINE# #UNINDENT# } ) #NEWLINE# if ( not untracked ) : #NEWLINE# #INDENT# command += ' -mard' #NEWLINE# #UNINDENT# ( _ , response , _ ) = run_shell_command ( command , shell = True , cwd = basepath ) #NEWLINE# if ( response is not None ) : #NEWLINE# #INDENT# if response . startswith ( 'abort' ) : #NEWLINE# #INDENT# raise VcsError ( ( 'Probable Bug; Could not call %s, cwd=%s' % ( command , basepath ) ) ) #NEWLINE# #UNINDENT# if ( ( len ( response ) > 0 ) and ( response [ ( - 1 ) ] != '\n' ) ) : #NEWLINE# #INDENT# response += '\n' #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# return basepath