@@ -0,0 +1,967 @@
+%22%22%22Copy overlay from one dataset to a derived dataset.%22%22%22%0A%0Aimport click%0A%0Aimport dtoolcore%0A%0A%0Adef ensure_uri(path_or_uri):%0A%0A    if ':' in path_or_uri:%0A        return path_or_uri%0A    else:%0A        return %22disk:%7B%7D%22.format(path_or_uri)%0A%0A%0A@click.command()%0A@click.argument('src_dataset_path')%0A@click.argument('dst_dataset_path')%0A@click.argument('overlay_name')%0Adef main(src_dataset_path, dst_dataset_path, overlay_name):%0A%0A    src_uri = ensure_uri(src_dataset_path)%0A    dst_uri = ensure_uri(dst_dataset_path)%0A%0A    src_dataset = dtoolcore.DataSet.from_uri(src_uri)%0A    dst_dataset = dtoolcore.DataSet.from_uri(dst_uri)%0A%0A    src_overlay = src_dataset.get_overlay(overlay_name)%0A    dst_overlay = %7B%7D%0A%0A    from_overlay = dst_dataset.get_overlay('from')%0A    for dst_id in dst_dataset.identifiers:%0A        src_id = from_overlay%5Bdst_id%5D%0A        dst_overlay%5Bdst_id%5D = src_overlay%5Bsrc_id%5D%0A%0A    dst_dataset.put_overlay(overlay_name, dst_overlay)%0A%0A%0Aif __name__ == '__main__':%0A    main()%0A

Add script to copy overlay from one dataset to another