#NEWLINE# def upconvert_bloom_to_config_branch( ) : #NEWLINE# #INDENT# global _has_checked_bloom_branch #NEWLINE# if _has_checked_bloom_branch : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# check_for_multiple_remotes ( ) #NEWLINE# if ( get_root ( ) is None ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# track_branches ( [ 'bloom' , BLOOM_CONFIG_BRANCH ] ) #NEWLINE# if ( show ( 'bloom' , PLACEHOLDER_FILE ) is not None ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# if ( show ( 'bloom' , 'bloom.conf' ) is not None ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# if ( not branch_exists ( 'bloom' ) ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# _has_checked_bloom_branch = True #NEWLINE# info ( "Moving configurations from deprecated 'bloom' branch to the '{0}' branch." . format ( BLOOM_CONFIG_BRANCH ) ) #NEWLINE# tmp_dir = mkdtemp ( ) #NEWLINE# git_root = get_root ( ) #NEWLINE# try : #NEWLINE# #INDENT# with inbranch ( 'bloom' ) : #NEWLINE# #INDENT# ignores = ( '.git' , '.gitignore' , '.svn' , '.hgignore' , '.hg' , 'CVS' ) #NEWLINE# configs = os . path . join ( tmp_dir , 'configs' ) #NEWLINE# my_copytree ( git_root , configs , ignores ) #NEWLINE# if [ x for x in os . listdir ( os . getcwd ( ) ) if ( x not in ignores ) ] : #NEWLINE# #INDENT# execute_command ( 'git rm -rf ./*' ) #NEWLINE# #UNINDENT# with open ( PLACEHOLDER_FILE , 'w' ) as f : #NEWLINE# #INDENT# f . write ( "This branch ('bloom') has been deprecated in favor of storing settings and overlay files in the master branch.\n\nPlease goto the master branch for anything which referenced the bloom branch.\n\nYou can delete this branch at your convenience.\n" ) #NEWLINE# #UNINDENT# execute_command ( ( 'git add ' + PLACEHOLDER_FILE ) ) #NEWLINE# if has_changes ( ) : #NEWLINE# #INDENT# execute_command ( 'git commit -m "DEPRECATING BRANCH"' ) #NEWLINE# #UNINDENT# #UNINDENT# if ( not branch_exists ( BLOOM_CONFIG_BRANCH ) ) : #NEWLINE# #INDENT# info ( "Creating '{0}' branch." . format ( BLOOM_CONFIG_BRANCH ) ) #NEWLINE# create_branch ( BLOOM_CONFIG_BRANCH , orphaned = True ) #NEWLINE# #UNINDENT# with inbranch ( BLOOM_CONFIG_BRANCH ) : #NEWLINE# #INDENT# my_copytree ( configs , git_root ) #NEWLINE# execute_command ( 'git add ./*' ) #NEWLINE# if has_changes ( ) : #NEWLINE# #INDENT# execute_command ( 'git commit -m "Moving configs from bloom branch"' ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# finally : #NEWLINE# #INDENT# if os . path . exists ( tmp_dir ) : #NEWLINE# #INDENT# shutil . rmtree ( tmp_dir )