Skip to content

Commit 3bdd642

Browse files
authored
feat(libvcs.cmd): Lite, typed, pythonic command wrappers for git, hg, mercurial (#319)
Experimental command wrappers
2 parents dee9d2d + 6f318f1 commit 3bdd642

File tree

19 files changed

+1371
-11
lines changed

19 files changed

+1371
-11
lines changed

docs/cmd/git.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# `libvcs.cmd.git`
2+
3+
For `git(1)`.
4+
5+
Compare to: [`fabtools.git`](https://fabtools.readthedocs.io/en/0.19.0/api/git.html#git-module),
6+
[`salt.modules.git`](https://docs.saltproject.io/en/latest/ref/modules/all/salt.modules.git.html),
7+
[`ansible.builtin.git`](https://docs.ansible.com/ansible/latest/collections/ansible/builtin/git_module.html)
8+
9+
```{eval-rst}
10+
.. autosummary::
11+
:recursive:
12+
13+
libvcs.cmd.git.Git
14+
```
15+
16+
```{eval-rst}
17+
.. automodule:: libvcs.cmd.git
18+
:members:
19+
:show-inheritance:
20+
:undoc-members:
21+
:inherited-members:
22+
```

docs/cmd/hg.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# `libvcs.cmd.hg`
2+
3+
For mercurial, aka `hg(1)`.
4+
5+
```{eval-rst}
6+
.. autosummary::
7+
:recursive:
8+
9+
libvcs.cmd.hg.Hg
10+
```
11+
12+
```{eval-rst}
13+
.. automodule:: libvcs.cmd.hg
14+
:members:
15+
:show-inheritance:
16+
:undoc-members:
17+
:inherited-members:
18+
```

docs/cmd/index.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
(cmd)=
2+
3+
# `libvcs.cmd`
4+
5+
Compare to: [`fabtools.git`](https://fabtools.readthedocs.io/en/0.19.0/api/git.html#git-module),
6+
[`salt.modules.git`](https://docs.saltproject.io/en/latest/ref/modules/all/salt.modules.git.html),
7+
[`ansible.builtin.git`](https://docs.ansible.com/ansible/latest/collections/ansible/builtin/git_module.html)
8+
9+
:::{warning}
10+
11+
All APIs are considered experimental and subject to break pre-1.0. They can and will break between
12+
versions.
13+
14+
:::
15+
16+
```{toctree}
17+
:caption: API
18+
19+
git
20+
hg
21+
svn
22+
```

docs/cmd/svn.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# `libvcs.cmd.svn`
2+
3+
For subversion, aka `svn(1)`
4+
5+
```{eval-rst}
6+
.. autosummary::
7+
:recursive:
8+
9+
libvcs.cmd.svn.Svn
10+
```
11+
12+
```{eval-rst}
13+
.. automodule:: libvcs.cmd.svn
14+
:members:
15+
:show-inheritance:
16+
:undoc-members:
17+
:inherited-members:
18+
```

docs/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
:hidden:
1010
1111
quickstart
12+
cmd/index
1213
states/index
1314
```
1415

docs/states/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,6 @@ See examples below of git, mercurial, and subversion.
4545
## Utility stuff
4646

4747
```{eval-rst}
48-
.. automodule:: libvcs.util
48+
.. automodule:: libvcs.cmd.core
4949
:members:
5050
```

libvcs/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
"""Repo package for libvcs."""
22
import logging
33

4+
from .cmd.core import CmdLoggingAdapter
45
from .states.base import BaseRepo
56
from .states.git import GitRepo
67
from .states.hg import MercurialRepo
78
from .states.svn import SubversionRepo
8-
from .util import CmdLoggingAdapter
99

1010
__all__ = [
1111
"GitRepo",

libvcs/cmd/__init__.py

Whitespace-only changes.

libvcs/util.py renamed to libvcs/cmd/core.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
import sys
88
from typing import Callable, Optional, Union
99

10-
from . import exc
11-
from .types import StrOrBytesPath
10+
from .. import exc
11+
from ..types import StrOrBytesPath
1212

1313
logger = logging.getLogger(__name__)
1414

0 commit comments

Comments
 (0)