1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/0f8890ee9be5/ Changeset: 0f8890ee9be5 Branch: api_copy_history User: aswarren Date: 2013-08-02 00:02:54 Summary: API enable copying from one history to another Affected #: 1 file diff -r fe5867b89ec01bfde18591df8809526d85fb821e -r 0f8890ee9be56218a50dea5505a500e3fb9b3762 lib/galaxy/webapps/galaxy/api/history_contents.py --- a/lib/galaxy/webapps/galaxy/api/history_contents.py +++ b/lib/galaxy/webapps/galaxy/api/history_contents.py @@ -174,6 +174,7 @@ #TODO: copy existing, accessible hda - dataset controller, copy_datasets #TODO: convert existing, accessible hda - model.DatasetInstance(or hda.datatype).get_converter_types from_ld_id = payload.get( 'from_ld_id', None ) + from_hda_id= payload.get( 'from_hda_id', None ) try: history = self.get_history( trans, history_id, check_ownership=True, check_accessible=False ) except Exception, e: @@ -197,7 +198,19 @@ hda = ld.library_dataset_dataset_association.to_history_dataset_association( history, add_to_history=True ) trans.sa_session.flush() return hda.get_api_value() - + elif from_hda_id: + try: + hda = self.get_dataset(trans, from_hda_id) + assert trans.user.id == hda.history.user_id, "HistoryDatasetAssocation does not belong to current user" + except AssertionError, e: + trans.response.status=400 + return "HistoryDatasetAssocation does not belong to current user" + except Exception, e: + return str(e) + data_copy=hda.copy(copy_children = True) + result=history.add_dataset(data_copy) + trans.sa_session.flush() + return result.get_api_value() else: # TODO: implement other "upload" methods here. trans.response.status = 501 Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.