#NEWLINE# def pull( self , source = None , target = None ) : #NEWLINE# #INDENT# log . debug ( 'Mercurial: Update repository.' ) #NEWLINE# source = ( source or self . source ) #NEWLINE# target = ( command or self . target ) #NEWLINE# command = [ 'hg' , 'revert' , '--all' , '--no-backup' ] #NEWLINE# execute ( command , target ) #NEWLINE# command = [ 'hg' , 'pull' , '-u' ] #NEWLINE# ( code , output , error ) = execute ( command , target ) #NEWLINE# if ( code == 0 ) : #NEWLINE# #INDENT# log . debug ( ( ( 'Mercurial: Repository at ' + source ) + ' updated.' ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# log . debug ( ( 'Mercurial: ' + unicode ( error ) ) ) #NEWLINE# log . debug ( 'Mercurial: Clone instead.' ) #NEWLINE# command = [ 'hg' , 'clone' , source , target ] #NEWLINE# ( code , output , error ) = execute ( command ) #NEWLINE# if ( code == 0 ) : #NEWLINE# #INDENT# log . debug ( ( ( 'Mercurial: Repository at ' + source ) + ' cloned.' ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise PullFromRepositoryException ( unicode ( error ) )