'Split-based modulestores need to import published blocks to both branches'

def import_xblock(self, user_id, course_key, block_type, block_id, fields=None, runtime=None, **kwargs):

    with self.bulk_operations(course_key):
        if (block_type == 'course'):
            block_id = self.DEFAULT_ROOT_COURSE_BLOCK_ID
        elif (block_type == 'library'):
            block_id = self.DEFAULT_ROOT_LIBRARY_BLOCK_ID
        new_usage_key = course_key.make_usage_key(block_type, block_id)
        is_course = isinstance(course_key, CourseLocator)
        if (is_course and (self.get_branch_setting() == ModuleStoreEnum.Branch.published_only)):
            draft_course = course_key.for_branch(ModuleStoreEnum.BranchName.draft)
            with self.branch_setting(ModuleStoreEnum.Branch.draft_preferred, draft_course):
                draft_block = self.import_xblock(user_id, draft_course, block_type, block_id, fields, runtime, **kwargs)
                return self.publish(draft_block.location.version_agnostic(), user_id, blacklist=EXCLUDE_ALL, **kwargs)
        partitioned_fields = self.partition_fields_by_scope(block_type, fields)
        course_key = self._map_revision_to_branch(course_key)
        return (self._update_item_from_fields(user_id, course_key, BlockKey(block_type, block_id), partitioned_fields, None, allow_not_found=True, force=True, **kwargs) or self.get_item(new_usage_key))
