mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-01 23:08:43 +01:00
Propagate sumbit_id_needed() to all commands
This commit is contained in:
@@ -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
@@ -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')
|
||||
|
||||
@@ -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
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user