experiments: store experiments in refs/exps instead of heads (#4910)

* experiments: commit to refs/exps/... instead of branch heads

* update exp show

* restore checkpoint_resume kwarg

* refactor new() to use experiments stash

* experiments: use refspecs to populate and collect executors

* experiments: use new stash and merge on exp checkout

* experiments: fix executor chdir

* experiments: update run and show

* skip checkout after reproduce

* checkpoints: use experiments refspecs

* check if workspace was stashed before applying

* exp show: unify checkpoint/standalone experiment collection

* git: move iter_refs to backend

* update for scm changes

* experiments: replace exp checkout in favor of exp apply

* git: handle rev_parse errors in resolve_commit

* update refs containing and baseline check

* fix sigint handling for checkpoints

* update checkpoint exists behavior

* fix checkpoint baseline behavior

* update tests

* experiments: update gc

* update show tests

* fix type checking errors

* update diff

* scm: add diff, describe

* experiments: generate human readable names

* exp run/resume: allow user specified exp name with -n/--name

* update tests

* experiments: add `exp branch` for promoting experiment to full branch

* fix test

* fix missing file

* experiments: explicitly close scm instances before cleaning up tmp dir
This commit is contained in:
Peter Rowlands (변기호)
2020-12-02 21:20:57 +09:00
committed by GitHub
parent c884c94d61
commit 176a23e291
22 changed files with 1252 additions and 946 deletions
+20
View File
@@ -32,6 +32,14 @@ class GitPythonBackend(BaseGitBackend): # pylint:disable=abstract-method
def remove_ref(self, name: str, old_ref: Optional[str] = None):
raise NotImplementedError
def iter_refs(self, base: Optional[str] = None):
from git import Reference
for ref in Reference.iter_items(self.scm.repo, common_path=base):
if base and base.endswith("/"):
base = base[:-1]
yield "/".join([base, ref.name])
def get_refs_containing(self, rev: str, pattern: Optional[str] = None):
from git.exc import GitCommandError
@@ -99,3 +107,15 @@ class GitPythonBackend(BaseGitBackend): # pylint:disable=abstract-method
args.append("--updateref")
args.append(ref)
self.git.reflog(*args)
def describe(
self,
rev: str,
base: Optional[str] = None,
match: Optional[str] = None,
exclude: Optional[str] = None,
) -> Optional[str]:
raise NotImplementedError
def diff(self, rev_a: str, rev_b: str, binary=False) -> str:
raise NotImplementedError