def run(self): recursive = not self.parsed_args.single_item stages = [] for target in self.parsed_args.targets: if StateFile._is_state_file(target): stage = StateFile.load(target) else: stage = StateFile.find_by_output(self.settings, target) if stage: stages.append(stage) self.repro_stages(stages, recursive, self.parsed_args.force) names = [os.path.relpath(stage.path) for stage in stages] return self.commit_if_needed('DVC repro: {}'.format(names))
def reproduce_dep(self, path, md5, recursive): if not self.settings.path_factory.is_data_item(path): if md5 != file_md5(os.path.join(self.git.git_dir_abs, path))[0]: self.log_repro_reason('source {} was changed'.format(path)) return True return False stage = StateFile.find_by_output(self.settings, path) if recursive: ReproStage(self.settings, stage, self._recursive, self._force).reproduce() stage = StateFile.load(stage.path) if md5 != stage.out[os.path.relpath(path, stage.cwd)]: self.log_repro_reason( 'data item {} was changed - md5 sum doesn\'t match'.format( path)) return True return False
def is_data_item(self, fname): return StateFile.find_by_output(self._settings, fname) != None