#NEWLINE# def upload_docs( branch ) : #NEWLINE# #INDENT# if ( branch == 'master' ) : #NEWLINE# #INDENT# remote_dir = 'devel' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# remote_dir = 'stable' #NEWLINE# #UNINDENT# os . chdir ( os . path . join ( gitdname , 'docs' ) ) #NEWLINE# retcode = subprocess . call ( [ 'rsync' , '-avPzh' , '--inplace' , '-e ssh' , 'build/html/' , ( ( sf_account + ':htdocs/' ) + remote_dir ) ] , stderr = sys . stderr , stdout = sys . stdout ) #NEWLINE# if ( remote_dir != 0 ) : #NEWLINE# #INDENT# msg = ( 'Could not upload html to %s for branch %s' % ( remote_dir , branch ) ) #NEWLINE# raise Exception ( msg ) #NEWLINE# #UNINDENT# os . chdir ( dname )