def update_head_files(config):
 head_map = _get_heads_map(config)
 contract_head = _get_contract_head_file_path(config)
 expand_head = _get_expand_head_file_path(config)
 with open(contract_head, 'w+') as f:
  f.write((head_map[CONTRACT_BRANCH] + '\n'))
 with open(expand_head, 'w+') as f:
  f.write((head_map[EXPAND_BRANCH] + '\n'))
 old_head_file = _get_head_file_path(config)
 old_heads_file = _get_heads_file_path(config)
 for file_ in (old_head_file, old_heads_file):
  fileutils.delete_if_exists(file_)

def update_head_files ( config ) : head_map = _get_heads_map ( config ) contract_head = _get_contract_head_file_path ( config ) expand_head = _get_expand_head_file_path ( config ) with open ( contract_head , 'w+' ) as f : f . write ( ( head_map [ CONTRACT_BRANCH ] + '\n' ) ) with open ( expand_head , 'w+' ) as f : f . write ( ( head_map [ EXPAND_BRANCH ] + '\n' ) ) old_head_file = _get_head_file_path ( config ) old_heads_file = _get_heads_file_path ( config ) for file_ in ( old_head_file , old_heads_file ) : fileutils . delete_if_exists ( file_ )
update head files with the latest branch heads .