dvc: add pull/push commands

We already have 'sync' command, but users report it to be confusing
when both local and remote files exist, so lets introduce two direct
commands to implicitly push and pull from cloud.

Fixes #157.

Signed-off-by: Ruslan Kuprieiev <[email protected]>
This commit is contained in:
Ruslan Kuprieiev
2017-08-12 22:44:10 +03:00
parent a234311980
commit db43e6bc91
4 changed files with 70 additions and 18 deletions
+19 -1
View File
@@ -6,4 +6,22 @@ class CmdDataSync(CmdBase):
def run(self):
with DvcLock(self.is_locker, self.git):
self.settings.cloud.sync(self.parsed_args.targets, self.parsed_args.jobs)
self.cloud.sync(self.parsed_args.targets, self.parsed_args.jobs)
class CmdDataPull(CmdBase):
def __init__(self, settings):
super(CmdDataPull, self).__init__(settings)
def run(self):
with DvcLock(self.is_locker, self.git):
self.cloud.pull(self.parsed_args.targets, self.parsed_args.jobs)
class CmdDataPush(CmdBase):
def __init__(self, settings):
super(CmdDataPush, self).__init__(settings)
def run(self):
with DvcLock(self.is_locker, self.git):
self.cloud.push(self.parsed_args.targets, self.parsed_args.jobs)