Skip to content

Commit 7c6f1dd

Browse files
committed
CHANGES(docs): API parameter and getter renames
why: Document the renamed Git command parameters and GitSync/HgSync remote getters for callers upgrading libvcs. what: - List the renamed cmd.git parameters and GitSync/HgSync get_remotes and get_remote methods under Breaking changes - Document HgSync.get_remote single-alias lookup under What's new
1 parent 2d7bf70 commit 7c6f1dd

1 file changed

Lines changed: 47 additions & 0 deletions

File tree

‎CHANGES‎

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,55 @@ version = git.version()
4040
info = git.build_options()
4141
```
4242

43+
#### Descriptive Git flag parameters and `get_` remote getters (#507)
44+
45+
`_all` flags in {mod}`libvcs.cmd.git` take descriptive parameter names, and
46+
remote getters on {class}`~libvcs.sync.git.GitSync` and
47+
{class}`~libvcs.sync.hg.HgSync` use the `get_` prefix:
48+
49+
| Method | Old parameter | New parameter |
50+
|--------|---------------|---------------|
51+
| {meth}`~libvcs.cmd.git.Git.clone` | `_all` | `all_branches` |
52+
| {meth}`~libvcs.cmd.git.Git.fetch` | `_all` | `all_remotes` |
53+
| {meth}`~libvcs.cmd.git.Git.pull` | `_all` | `all_remotes` |
54+
| {meth}`~libvcs.cmd.git.Git.help` | `_all` | `show_all` |
55+
| {meth}`~libvcs.cmd.git.Git.rev_list` | `_all` | `include_all_refs` |
56+
| {meth}`~libvcs.cmd.git.GitRemoteCmd.get_url` | `_all` | `all_urls` |
57+
| {meth}`~libvcs.cmd.git.GitStashCmd.save` | `_all` | `include_ignored` |
58+
| {meth}`~libvcs.cmd.git.GitStashManager.push` | `_all` | `include_ignored` |
59+
| {meth}`~libvcs.cmd.git.GitBranchManager.ls` | `_all` | `all_branches` |
60+
61+
| Class | Old method | New method |
62+
|-------|------------|------------|
63+
| {class}`~libvcs.sync.git.GitSync` | `remotes()` | {meth}`~libvcs.sync.git.GitSync.get_remotes` |
64+
| {class}`~libvcs.sync.git.GitSync` | `remote(name)` | {meth}`~libvcs.sync.git.GitSync.get_remote` |
65+
| {class}`~libvcs.sync.hg.HgSync` | `remotes()` | {meth}`~libvcs.sync.hg.HgSync.get_remotes` |
66+
67+
```python
68+
# Before
69+
git.fetch(_all=True)
70+
git.stashes.push(_all=True)
71+
git_repo.remotes()
72+
git_repo.remote("origin")
73+
hg_repo.remotes()
74+
75+
# After
76+
git.fetch(all_remotes=True)
77+
git.stashes.push(include_ignored=True)
78+
git_repo.get_remotes()
79+
git_repo.get_remote("origin")
80+
hg_repo.get_remotes()
81+
```
82+
4383
### What's new
4484

85+
#### Single-alias Mercurial remote lookup (#507)
86+
87+
{meth}`~libvcs.sync.hg.HgSync.get_remote` reads one effective Mercurial
88+
`[paths]` alias by name (including `%include` files) and returns an
89+
{class}`~libvcs.sync.hg.HgRemote`, or `None` when absent or unreadable,
90+
matching {meth}`~libvcs.sync.git.GitSync.get_remote`.
91+
4592
#### Structured Git build options (#491)
4693

4794
{meth}`~libvcs.cmd.git.Git.build_options` parses `git version --build-options`

0 commit comments

Comments
 (0)