mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-11 07:18:28 +01:00
exp run: do nothing if result matches parent (HEAD) (#5600)
This commit is contained in:
@@ -725,10 +725,14 @@ class Experiments:
|
||||
rel_cwd=relpath(os.getcwd(), self.scm.root_dir),
|
||||
)
|
||||
|
||||
if not exec_result.exp_hash or not exec_result.ref_info:
|
||||
if not exec_result.exp_hash:
|
||||
raise DvcException(
|
||||
f"Failed to reproduce experiment '{rev[:7]}'"
|
||||
)
|
||||
if not exec_result.ref_info:
|
||||
# repro succeeded but result matches baseline
|
||||
# (no experiment generated or applied)
|
||||
return {}
|
||||
exp_rev = self.scm.get_ref(str(exec_result.ref_info))
|
||||
self.scm.set_ref(EXEC_APPLY, exp_rev)
|
||||
return {exp_rev: exec_result.exp_hash}
|
||||
|
||||
@@ -358,6 +358,8 @@ class BaseExecutor(ABC):
|
||||
if os.path.exists(args_path):
|
||||
args, kwargs = cls.unpack_repro_args(args_path)
|
||||
remove(args_path)
|
||||
# explicitly git rm/unstage the args file
|
||||
dvc.scm.add([args_path])
|
||||
else:
|
||||
args = []
|
||||
kwargs = {}
|
||||
|
||||
Reference in New Issue
Block a user