MCPcopy
hub / github.com/treeverse/dvc / remove_stage

Method remove_stage

dvc/dvcfile.py:372–388  ·  view source on GitHub ↗
(self, stage)

Source from the content-addressed store, hash-verified

370 self._lockfile.remove()
371
372 def remove_stage(self, stage):
373 self._check_if_parametrized(stage, "remove")
374 self._lockfile.remove_stage(stage)
375 if not self.exists():
376 return
377
378 d, _ = self._load_yaml(round_trip=True)
379 if stage.name not in d.get("stages", {}):
380 return
381
382 logger.debug("Removing '%s' from '%s'", stage.name, self.path)
383 del d["stages"][stage.name]
384
385 if d["stages"]:
386 dump_yaml(self.path, d)
387 else:
388 super().remove()
389
390 def merge(self, ancestor, other, allowed=None):
391 raise NotImplementedError

Callers

nothing calls this directly

Calls 7

dump_yamlFunction · 0.90
_load_yamlMethod · 0.80
remove_stageMethod · 0.45
existsMethod · 0.45
getMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected