| 551 | |
| 552 | @classmethod |
| 553 | def _repro_commit( |
| 554 | cls, |
| 555 | dvc, |
| 556 | info, |
| 557 | exp_hash, |
| 558 | repro_force, |
| 559 | message: Optional[str] = None, |
| 560 | ) -> tuple[Optional[str], Optional["ExpRefInfo"], bool]: |
| 561 | with cls.auto_push(dvc): |
| 562 | cls.commit( |
| 563 | dvc.scm, |
| 564 | exp_hash, |
| 565 | exp_name=info.name, |
| 566 | force=repro_force, |
| 567 | message=message, |
| 568 | ) |
| 569 | |
| 570 | ref: Optional[str] = dvc.scm.get_ref(EXEC_BRANCH, follow=False) |
| 571 | exp_ref: Optional[ExpRefInfo] = ExpRefInfo.from_ref(ref) if ref else None |
| 572 | if cls.WARN_UNTRACKED: |
| 573 | untracked = dvc.scm.untracked_files() |
| 574 | if untracked: |
| 575 | logger.warning( |
| 576 | ( |
| 577 | "The following untracked files were present in " |
| 578 | "the experiment directory after reproduction but " |
| 579 | "will not be included in experiment commits:\n" |
| 580 | "\t%s" |
| 581 | ), |
| 582 | ", ".join(untracked), |
| 583 | ) |
| 584 | return ref, exp_ref, repro_force |
| 585 | |
| 586 | @classmethod |
| 587 | @contextmanager |