Propagate sumbit_id_needed() to all commands

This commit is contained in:
Dmitry Petrov
2017-03-26 17:43:27 -07:00
parent 1222d7d8b8
commit 0525caf229
4 changed files with 4 additions and 22 deletions
+1 -5
View File
@@ -51,12 +51,8 @@ class CmdDataImport(CmdBase):
for file in self.args.input:
self.import_file(file, output, self.args.is_reproducible)
if self.skip_git_actions:
self.not_committed_changes_warning()
return 0
message = 'DVC data import: {} {}'.format(' '.join(self.args.input), self.args.output)
self.git.commit_all_changes_and_log_status(message)
return self.commit_if_needed(message)
finally:
lock.release()
pass
+1 -6
View File
@@ -91,17 +91,12 @@ SecurityGroup = dvc-group'''
self.modify_gitignore(cache_dir_path.name)
if self.skip_git_actions:
self.not_committed_changes_warning()
return 0
message = 'DVC init. data dir {}, cache dir {}, state dir {}'.format(
data_dir_path.name,
cache_dir_path.name,
state_dir_path.name
)
self.git.commit_all_changes_and_log_status(message)
pass
return self.commit_if_needed(message)
def modify_gitignore(self, cache_dir_name):
gitignore_file = os.path.join(self.git.git_dir, '.gitignore')
+1 -6
View File
@@ -88,12 +88,7 @@ class CmdRepro(CmdRun):
return 1
if changed:
if self.skip_git_actions:
self.not_committed_changes_warning()
return 1
message = 'DVC repro: {}'.format(' '.join(self.args.target))
self.git.commit_all_changes_and_log_status(message)
self.commit_if_needed('DVC repro: {}'.format(' '.join(self.args.target)))
finally:
lock.release()
return 0
+1 -5
View File
@@ -67,12 +67,8 @@ class CmdRun(CmdBase):
if not self.run_command(self._args_unkn, self.args.stdout, self.args.stderr):
return 1
if self.skip_git_actions:
self.not_committed_changes_warning()
return 0
message = 'DVC run: {}'.format(' '.join(sys.argv))
self.git.commit_all_changes_and_log_status(message)
self.commit_if_needed(message)
finally:
lock.release()