@@ -25,29 +25,36 @@ $ pip install --user ptpython
25
25
$ ptpython
26
26
```
27
27
28
- ## Usage
28
+ ## Commands (experimental)
29
29
30
- Create a [ Repo] ( https://libvcs.git-pull.com/api.html#creating-a-repo-object ) object of the project
31
- to inspect / checkout / update:
30
+ Simple [ ` subprocess ` ] ( https://docs.python.org/3/library/subprocess.html ) wrappers around ` git(1) ` ,
31
+ ` hg(1) ` , ` svn(1) ` . Here is [ ` Git ` ] ( https://libvcs.git-pull.com/cmd/git.html#libvcs.cmd.git.Git ) w/
32
+ [ ` Git.clone ` ] ( http://libvcs.git-pull.com/cmd/git.html#libvcs.cmd.git.Git.clone ) :
32
33
33
34
``` python
34
- >> > from libvcs.shortcuts import create_repo_from_pip_url, create_repo
35
-
36
- # repo is an object representation of a vcs repository.
37
- >> > r = create_repo(
38
- ... url = ' https://www.github.com/vcs-python/libtmux' ,
39
- ... vcs = ' git' ,
40
- ... dir = ' /tmp/libtmux'
41
- ... )
35
+ import pathlib
36
+ from libvcs.cmd.git import Git
37
+
38
+ git = Git(dir = pathlib.Path.cwd() / ' my_git_repo' )
39
+ git.clone(url = ' https://github.com/vcs-python/libvcs.git' )
42
40
```
43
41
44
- Initialize via "pip-style URLs":
42
+ ## States
43
+
44
+ Create a [ ` GitRepo ` ] ( https://libvcs.git-pull.com/states/git.html#libvcs.states.git.GitRepo ) object
45
+ of the project to inspect / checkout / update:
45
46
46
47
``` python
47
- >> > r = create_repo_from_pip_url(
48
- ... pip_url = ' git+https://www.github.com/vcs-python/libtmux' ,
49
- ... dir = ' /tmp/libtmux'
50
- ... )
48
+ import pathlib
49
+ from libvcs.states.git import GitRepo
50
+
51
+ repo = GitRepo(
52
+ url = " https://github.com/vcs-python/libvcs" ,
53
+ dir = pathlib.Path().cwd() / " my_repo" ,
54
+ remotes = {
55
+ ' gitlab' : ' https://gitlab.com/vcs-python/libvcs'
56
+ }
57
+ )
51
58
```
52
59
53
60
Update / clone repo:
0 commit comments