Exemple #1
0
    def collect_targets(self):
        targets = []

        for fname in self.git.get_last_merge_changed_files():
            if not StateFile._is_state_file(fname):
                continue

            state = StateFile.load(fname)
            if not state.cmd and state.locked:
                targets.append(fname)

        return targets
Exemple #2
0
    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))