10000 Sync: Use cmd library by tony · Pull Request #430 · vcs-python/libvcs · GitHub
[go: up one dir, main page]

Skip to content

Sync: Use cmd library #430

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 33 commits into from
Oct 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
348532c
refactor(run): log_in_real_time, add behavior and make false by default
tony Oct 17, 2022
2bf56a1
feat(cmd): Add hg update
tony Oct 13, 2022
59be5a1
feat(cmd[hg.clone]): Add make_parents, default=True
tony Oct 14, 2022
1c36ea0
feat(cmd[hg]): check_returncode, quiet, verbose
tony Oct 14, 2022
9d8c9a5
feat(cmd[hg]): Add pull
tony Oct 14, 2022
76e1d69
refactor(sync[hg]): Move to cmd
tony Oct 13, 2022
9ebb8fa
ci(git): Add LF line ending for .dump files
tony Oct 16, 2022
404f80f
tests(svn): Add repotest data
tony Oct 16, 2022
37d21bd
feat(pytest_plugin): Use SVN import dump
tony Oct 16, 2022
190106e
refactor (sync[svn}): Remove convert_pip_url
tony Oct 16, 2022
834096c
feat(cmd[svn]): More SVN command support
tony Oct 16, 2022
8bbf668
feat(sync[svn]): Move to cmd
tony Oct 16, 2022
bff3a02
feat(cmd[svn]): Update to svn dumpfile
tony Oct 16, 2022
d9d2cc4
refactor(cmd[svn]): Remove get_rev_options() (unused)
tony Oct 16, 2022
3c24fb4
feat(cmd[svn]): Fill out svn.info
tony Oct 16, 2022
30f5a9f
refactor(sync[svn]): Remove last non-cmd dependency
tony Oct 16, 2022
0099900
feat(cmd[svn]): Much more SVN support and tests
tony Oct 23, 2022
6bb9391
feat(cmd[git]): Add Git.version
tony Oct 16, 2022
7dc3a7c
feat(cmd[git]): Improve config param by using dict
tony Oct 16, 2022
a1c5fc9
feat(cmd[git]): Add GitSubmodule (initial)
tony Oct 16, 2022
da44d50
feat(cmd[git]): Add submodule and remote
tony Oct 16, 2022
3176cf6
feat(cmd[git]): More commands
tony Oct 22, 2022
502a52d
feat(sync[git]): Moving to cmd
tony Oct 16, 2022
0d0659b
refactor(sync[git]): Callback pass-through
tony Oct 23, 2022
b561ac0
refactor(git[sync]): Move to cmd
tony Oct 22, 2022
d34382b
test(sync[git]): Update to GitSync.cmd.symbolic_ref
tony Oct 22, 2022
6ec9990
test(sync[git]): Update progress callback
tony Oct 23, 2022
de39b02
chore(git[cmd]): Clean up typings for sub-commands
tony Oct 23, 2022
5cdb96a
feat(cmd[svn]): Add progress_callback
tony Oct 23, 2022
8f7b27c
refactor(sync[svn]): Attach command as attribute
tony Oct 23, 2022
ec17ada
refactor(cmd[hg]): Pass-through progress_callback
tony Oct 23, 2022
0f65f27
refactor(sync[hg]): Use cmd via attribute
tony Oct 23, 2022
90abbe6
docs(CHANGES): Note bolstering of command and sync
tony Oct 23, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.dump eol=lf
42 changes: 42 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,48 @@ $ pip install --user --upgrade --pre libvcs

<!-- Maintainers, insert changes / features for the next release here -->

### New features

#### Commands

via #430

- Git

- Support for progress bar
- Add subcommands for:
- stash: {attr}`Git.stash <libvcs.cmd.git.Git.stash>` -> {class}`libvcs.cmd.git.GitStashCmd`
- remote: {attr}`Git.remote <libvcs.cmd.git.Git.remote>` -> {class}`libvcs.cmd.git.GitRemoteCmd`
- submodule: {attr}`Git.submodule <libvcs.cmd.git.Git.submodule>` ->
{class}`libvcs.cmd.git.GitSubmoduleCmd`
- Added commands for:
- {meth}`libvcs.cmd.git.Git.rev_parse`
- {meth}`libvcs.cmd.git.Git.rev_list`
- {meth}`libvcs.cmd.git.Git.symbolic_ref`
- {meth}`libvcs.cmd.git.Git.show_ref`

- SVN

New and improved:

- {meth}`libvcs.cmd.svn.Svn.unlock`
- {meth}`libvcs.cmd.svn.Svn.lock`
- {meth}`libvcs.cmd.svn.Svn.propset`

- Mercurial

New and improved:

- {meth}`libvcs.cmd.hg.Hg.pull`
- {meth}`libvcs.cmd.hg.Hg.clone`
- {meth}`libvcs.cmd.hg.Hg.update`

#### Syncing

via #430

Git, SVN, and Mercurial have moved to `libvcs.cmd`

## libvcs 0.18.1 (2022-10-23)

_Maintenance only release, no bug fixes or features_
Expand Down
9 changes: 8 additions & 1 deletion src/libvcs/_internal/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def run(
# Not until sys.version_info >= (3, 10)
# pipesize: int = -1,
# custom
log_in_real_time: bool = True,
log_in_real_time: bool = False,
check_returncode: bool = True,
callback: Optional[ProgressCallbackProtocol] = None,
) -> str:
Expand Down Expand Up @@ -196,6 +196,13 @@ def progress_cb(output, timestamp):
all_output: list[str] = []
code = None
line = None
if log_in_real_time and callback is None:

def progress_cb(output: AnyStr, timestamp: datetime.datetime) -> None:
sys.stdout.write(str(output))
sys.stdout.flush()

callback = progress_cb
while code is None:
code = proc.poll()

Expand Down
Loading
0