datalad.api.rerun(revision='HEAD', since=None, dataset=None, branch=None, message=None, onto=None, script=None, report=False)

This will unlock any dataset content that is on record to have been modified by the command in the specified revision. It will then re-execute the command in the recorded path (if it was inside the dataset). Afterwards, all modifications will be saved.

Report mode

When called with report=True, this command reports information about what would be re-executed as a series of records. There will be a record for each revision in the specified revision range. Each of these will have one of the following “rerun_action” values:

• run: the revision has a recorded command that would be re-executed
• skip: the revision does not have a recorded command and would be skipped
• pick: the revision does not have a recorded command and would be cherry picked

The decision to skip rather than cherry pick a revision is based on whether the revision would be reachable from HEAD at the time of execution.

In addition, when a starting point other than HEAD is specified, there is a rerun_action value “checkout”, in which case the record includes information about the revision the would be checked out before rerunning any commands.

Examples

Re-execute the command from the previous commit:

% datalad rerun


Re-execute any commands in the last five commits:

% datalad rerun --since=HEAD~5


Do the same as above, but re-execute the commands on top of HEAD~5 in a detached state:

% datalad rerun --onto= --since=HEAD~5


Re-execute all previous commands and compare the old and new results:

% # on master branch