mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-11 23:10:10 +01:00
Rename -r to -g (--out-git). Close #322
This commit is contained in:
+2
-2
@@ -103,8 +103,8 @@ def parse_args(argv=None):
|
||||
action='append',
|
||||
default=[],
|
||||
help='Declare output data file (sync to cloud) for reproducible cmd.')
|
||||
run_parser.add_argument('-r',
|
||||
'--reg',
|
||||
run_parser.add_argument('-g',
|
||||
'--out-git',
|
||||
action='append',
|
||||
default=[],
|
||||
help='Declare output regular file (sync to Git) for reproducible cmd.')
|
||||
|
||||
@@ -9,14 +9,14 @@ class CommandFile(StateFileBase):
|
||||
|
||||
PARAM_CMD = 'cmd'
|
||||
PARAM_OUT = 'out'
|
||||
PARAM_REG = 'reg'
|
||||
PARAM_OUT_GIT = 'out-git'
|
||||
PARAM_DEPS = 'deps'
|
||||
PARAM_LOCK = 'locked'
|
||||
|
||||
def __init__(self, cmd, out, reg, deps, locked, fname):
|
||||
def __init__(self, cmd, out, out_git, deps, locked, fname):
|
||||
self.cmd = cmd
|
||||
self.out = out
|
||||
self.reg = reg
|
||||
self.out_git = out_git
|
||||
self.deps = deps
|
||||
self.locked = locked
|
||||
self.fname = fname
|
||||
@@ -26,7 +26,7 @@ class CommandFile(StateFileBase):
|
||||
data = {
|
||||
self.PARAM_CMD: self.cmd,
|
||||
self.PARAM_OUT: self.out,
|
||||
self.PARAM_REG: self.reg,
|
||||
self.PARAM_OUT_GIT: self.out_git,
|
||||
self.PARAM_DEPS: self.deps,
|
||||
self.PARAM_LOCK: self.locked
|
||||
}
|
||||
@@ -44,7 +44,7 @@ class CommandFile(StateFileBase):
|
||||
def loadd(data, fname=None):
|
||||
return CommandFile(data.get(CommandFile.PARAM_CMD, None),
|
||||
data.get(CommandFile.PARAM_OUT, None),
|
||||
data.get(CommandFile.PARAM_REG, None),
|
||||
data.get(CommandFile.PARAM_OUT_GIT, None),
|
||||
data.get(CommandFile.PARAM_DEPS, None),
|
||||
data.get(CommandFile.PARAM_LOCK, None),
|
||||
fname)
|
||||
|
||||
+2
-2
@@ -21,7 +21,7 @@ class CmdRun(CmdBase):
|
||||
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.reg,
|
||||
command = CommandFile(cmd, self.parsed_args.out, self.parsed_args.out_git,
|
||||
self.parsed_args.deps, self.parsed_args.lock, None)
|
||||
|
||||
self.run_command(self.settings, command)
|
||||
@@ -32,7 +32,7 @@ class CmdRun(CmdBase):
|
||||
Executor.exec_cmd_only_success(command.cmd, shell=True)
|
||||
|
||||
CmdRun.apply_to_files(command.out, command, CmdRun._create_cache_and_state_files, settings)
|
||||
CmdRun.apply_to_files(command.reg, command, CmdRun._create_state_file, settings)
|
||||
CmdRun.apply_to_files(command.out_git, command, CmdRun._create_state_file, settings)
|
||||
|
||||
@staticmethod
|
||||
def apply_to_files(files, command, func, settings):
|
||||
|
||||
Reference in New Issue
Block a user