#NEWLINE# def get_url( self ) : #NEWLINE# #INDENT# '\n        :returns: BZR URL of the branch (output of bzr info command),\n        or None if it cannot be determined\n        ' #NEWLINE# result = None #NEWLINE# if self . detect_presence ( ) : #NEWLINE# #INDENT# cmd = ( 'bzr info %s' % self . _path ) #NEWLINE# ( _ , output , _ ) = run_shell_command ( cmd , shell = True , us_env = True ) #NEWLINE# matches = [ l for l in output . splitlines ( ) if l . startswith ( '  parent branch: ' ) ] #NEWLINE# if matches : #NEWLINE# #INDENT# ppath = url2pathname ( matches [ 0 ] [ len ( '  parent branch: ' ) : ] ) #NEWLINE# if ( ( ppath is not None ) and os . path . isdir ( ppath ) and ( not os . path . isabs ( ppath ) ) ) : #NEWLINE# #INDENT# result = os . path . abspath ( os . path . join ( os . getcwd ( ) , ppath ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# result = ppath #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# return result