diff --git a/dvc/command/add.py b/dvc/command/add.py index 069c45d6b..945292b31 100644 --- a/dvc/command/add.py +++ b/dvc/command/add.py @@ -1,6 +1,6 @@ import os -from dvc.command.base import CmdBase, DvcLock +from dvc.command.common.base import CmdBase from dvc.logger import Logger from dvc.state_file import StateFile from dvc.command.run import CommandFile @@ -49,9 +49,8 @@ class CmdAdd(CmdBase): Logger.debug('State file "{}" was created'.format(data_item.state.relative)) def run(self): - with DvcLock(self.is_locker, self.git): - targets = self.collect_targets(self.parsed_args.input) - self.add_files(targets) - self.create_state_files(targets) - msg = 'DVC add: {}'.format(str(self.parsed_args.input)) - self.commit_if_needed(msg) + targets = self.collect_targets(self.parsed_args.input) + self.add_files(targets) + self.create_state_files(targets) + msg = 'DVC add: {}'.format(str(self.parsed_args.input)) + self.commit_if_needed(msg) diff --git a/dvc/command/repro.py b/dvc/command/repro.py index 32e4e5c65..2e3e6fe8d 100644 --- a/dvc/command/repro.py +++ b/dvc/command/repro.py @@ -1,7 +1,6 @@ import os import copy -from dvc.command.base import DvcLock from dvc.command.run import CmdRun, CommandFile from dvc.logger import Logger from dvc.exceptions import DvcException diff --git a/dvc/command/run.py b/dvc/command/run.py index a2591a0a4..2cd360499 100644 --- a/dvc/command/run.py +++ b/dvc/command/run.py @@ -70,17 +70,15 @@ class CmdRun(CmdBase): super(CmdRun, self).__init__(settings) def run(self): - with DvcLock(self.is_locker, self.git): - cmd = ' '.join(self.parsed_args.command) - try: - command = CommandFile.load(cmd) - #FIXME OLOLO don't forget to overwrite with cmdline args - except Exception as exc: - Logger.debug("Failed to load {}: {}".format(cmd, str(exc))) - command = CommandFile(cmd, self.parsed_args.out, self.parsed_args.deps, self.parsed_args.lock, None) + cmd = ' '.join(self.parsed_args.command) + try: + command = CommandFile.load(cmd) + except Exception as exc: + Logger.debug("Failed to load {}: {}".format(cmd, str(exc))) + command = CommandFile(cmd, self.parsed_args.out, self.parsed_args.deps, self.parsed_args.lock, None) - self.run_command(self.settings, command) - return self.commit_if_needed('DVC run: {}'.format(command.cmd)) + self.run_command(self.settings, command) + return self.commit_if_needed('DVC run: {}'.format(command.cmd)) @staticmethod def run_command(settings, command): diff --git a/dvc/config.py b/dvc/config.py index af9b97ca7..ff5de8435 100644 --- a/dvc/config.py +++ b/dvc/config.py @@ -35,15 +35,15 @@ class ConfigI(object): self._cloud = cloud self._conf_parser = conf_parser - # @classmethod - # def CACHE_DIR(self): - # """ Directory with cached data files """ - # return os.path.join(self.CONFIG_DIR, self.CACHE_DIR_NAME) - # - # @classmethod - # def STATE_DIR(self): - # """ Directory with state files """ - # return os.path.join(self.CONFIG_DIR, self.STATE_DIR_NAME) + @property + def cache_dir(self): + """ Directory with cached data files """ + return self.CACHE_DIR + + @property + def state_dir(self): + """ Directory with state files """ + return self.STATE_DIR @property def cloud(self):