experiments: add dvc exp push/pull/list (#5042)

* git: add support for on_diverged in push_refspec

* experiments: update executor for push-refspec changes

* experiments: implement push()

* tests: add tests for experiments.push

* git: add iter_remote_refs

* roughly equivalent to `git ls-remote --refs`

* experiments: add experiments.list for listing local and remote
experiments

* refactor git upstream/downstream in tests

* experiments: add experiments.pull

* experiments: add CLI commands for push/pull/list

* exp list: drop short options

* experiments: s/list/ls/

* dulwich: catch not repo errors when creating remote client

* fix remote rev resolution for list

* fix command test

* add tests for push/pull with ambiguous experiment names
This commit is contained in:
Peter Rowlands (변기호)
2020-12-08 21:20:03 +09:00
committed by GitHub
parent a41e23a453
commit 51fa0f5c38
15 changed files with 830 additions and 44 deletions
+12 -2
View File
@@ -362,6 +362,9 @@ class GitPythonBackend(BaseGitBackend): # pylint:disable=abstract-method
base = base[:-1]
yield "/".join([base, ref.name])
def iter_remote_refs(self, url: str, base: Optional[str] = None):
raise NotImplementedError
def get_refs_containing(self, rev: str, pattern: Optional[str] = None):
from git.exc import GitCommandError
@@ -379,7 +382,14 @@ class GitPythonBackend(BaseGitBackend): # pylint:disable=abstract-method
except GitCommandError:
pass
def push_refspec(self, url: str, src: Optional[str], dest: str):
def push_refspec(
self,
url: str,
src: Optional[str],
dest: str,
force: bool = False,
on_diverged: Optional[Callable[[str, str], bool]] = None,
):
raise NotImplementedError
def fetch_refspecs(
@@ -387,7 +397,7 @@ class GitPythonBackend(BaseGitBackend): # pylint:disable=abstract-method
url: str,
refspecs: Iterable[str],
force: Optional[bool] = False,
on_diverged: Optional[Callable[[bytes, bytes], bool]] = None,
on_diverged: Optional[Callable[[str, str], bool]] = None,
):
raise NotImplementedError