#NEWLINE# def _get_outgoing_changesets( self , remote , rev = None ) : #NEWLINE# #INDENT# 'Return the outgoing changesets between us and a remote.\n\n        This will return a list of tuples of (rev, node, branch) for\n        each outgoing changeset. The list will be sorted in revision order.\n\n        If rev is specified, we will limit the changesets to ancestors of\n        the specified revision. Otherwise, all changesets not in the remote\n        will be returned.\n        ' #NEWLINE# outgoing_changesets = [ ] #NEWLINE# args = [ 'hg' , '-q' , 'outgoing' , '--template' , '{rev}\\t{node|short}\\t{branch}\\n' , remote ] #NEWLINE# if rev : #NEWLINE# #INDENT# args . extend ( [ '-r' , rev ] ) #NEWLINE# #UNINDENT# raw_outgoing = execute ( args , env = self . _hg_env , extra_ignore_errors = ( 1 , ) ) #NEWLINE# for line in raw_outgoing . splitlines ( ) : #NEWLINE# #INDENT# if ( not line ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# if line . startswith ( 'warning: ' ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# ( rev , node , branch ) = [ f . strip ( ) for f in line . split ( '\t' ) ] #NEWLINE# branch = ( branch or 'default' ) #NEWLINE# if ( not rev . isdigit ( ) ) : #NEWLINE# #INDENT# raise Exception ( ( 'Unexpected output from hg: %s' % line ) ) #NEWLINE# #UNINDENT# logging . debug ( ( 'Found outgoing changeset %s:%s' % ( rev , node ) ) ) #NEWLINE# outgoing_changesets . append ( ( int ( rev ) , node , branch ) ) #NEWLINE# #UNINDENT# return outgoing_changesets