mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-11-04 05:42:12 +08:00
We were copying datasets and not assigning them new HIDs in some cases (the newer collection operations apply_rules, tag_from_file were doing the right thing here but it looks like we didn't go back and fix older operations). With the uniform handling of dataset copying in place - I used the much more efficient history.add_datasets instead of history.add_dataset. This also optimizes the actual HDA copying by eliminating some extra flushes. hda.copy() would flush to get an HDA before copying metadata but this is only needed if there are FileParameter metadata types (e.g. bams) so I made that flush conditional as well as the final one. So for most datatypes - this eliminates two extra flushes per dataset copied. Rebased with fix for issue pointed out by @nsoranzo - cleaned up _add_datasets_to_history to just consume values directly. Using itervalues since these methods have performance issues and these lists can be quite large.