def _get_backup_basename(source_dir):
    """
    Get the base name used to name destination directories.
    """
    from os.path import basename, dirname
    name = basename(source_dir)
    if not name:
        name = basename(dirname(source_dir))
    return name
