Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
14 changes: 12 additions & 2 deletions libvcs/cmd/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@


class Git:
def __init__(self, dir: StrPath):
def __init__(self, *, dir: StrPath):
"""Lite, typed, pythonic wrapper for git(1).

Parameters
Expand All @@ -36,7 +36,7 @@ def __repr__(self):
def run(
self,
args: _CMD,
/,
*,
# Print-and-exit flags
version: Optional[bool] = None,
help: Optional[bool] = None,
Expand Down Expand Up @@ -185,6 +185,7 @@ def run(

def clone(
self,
*,
url: str,
separate_git_dir: Optional[StrOrBytesPath] = None,
template: Optional[str] = None,
Expand Down Expand Up @@ -312,6 +313,7 @@ def clone(

def fetch(
self,
*,
reftag: Optional[Any] = None,
deepen: Optional[str] = None,
depth: Optional[str] = None,
Expand Down Expand Up @@ -469,6 +471,7 @@ def fetch(

def rebase(
self,
*,
upstream: Optional[str] = None,
onto: Optional[str] = None,
branch: Optional[str] = None,
Expand Down Expand Up @@ -665,6 +668,7 @@ def rebase(

def pull(
self,
*,
reftag: Optional[Any] = None,
repository: Optional[str] = None,
deepen: Optional[str] = None,
Expand Down Expand Up @@ -943,6 +947,7 @@ def pull(

def init(
self,
*,
template: Optional[str] = None,
separate_git_dir: Optional[StrOrBytesPath] = None,
object_format: Optional[Literal["sha1", "sha256"]] = None,
Expand Down Expand Up @@ -1022,6 +1027,7 @@ def init(

def help(
self,
*,
all: Optional[bool] = None,
verbose: Optional[bool] = None,
no_external_commands: Optional[bool] = None,
Expand Down Expand Up @@ -1105,6 +1111,7 @@ def help(

def reset(
self,
*,
quiet: Optional[bool] = None,
refresh: Optional[bool] = None,
no_refresh: Optional[bool] = None,
Expand Down Expand Up @@ -1196,6 +1203,7 @@ def reset(

def checkout(
self,
*,
quiet: Optional[bool] = None,
progress: Optional[bool] = None,
no_progress: Optional[bool] = None,
Expand Down Expand Up @@ -1329,6 +1337,7 @@ def checkout(

def status(
self,
*,
verbose: Optional[bool] = None,
long: Optional[bool] = None,
short: Optional[bool] = None,
Expand Down Expand Up @@ -1456,6 +1465,7 @@ def status(

def config(
self,
*,
replace_all: Optional[bool] = None,
get: Optional[str] = None,
get_all: Optional[bool] = None,
Expand Down
4 changes: 3 additions & 1 deletion libvcs/cmd/hg.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class HgPagerType(enum.Enum):


class Hg:
def __init__(self, dir: StrPath):
def __init__(self, *, dir: StrPath):
"""Lite, typed, pythonic wrapper for hg(1).

Parameters
Expand All @@ -51,6 +51,7 @@ def __repr__(self):
def run(
self,
args: _CMD,
*,
config: Optional[str] = None,
repository: Optional[str] = None,
quiet: Optional[bool] = None,
Expand Down Expand Up @@ -161,6 +162,7 @@ def run(

def clone(
self,
*,
url: str,
no_update: Optional[str] = None,
update_rev: Optional[str] = None,
Expand Down
14 changes: 8 additions & 6 deletions libvcs/cmd/svn.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@


class Svn:
def __init__(self, dir: StrPath):
def __init__(self, *, dir: StrPath):
"""Lite, typed, pythonic wrapper for svn(1).

Parameters
Expand All @@ -38,6 +38,7 @@ def __repr__(self):
def run(
self,
args: _CMD,
*,
quiet: Optional[bool] = None,
username: Optional[str] = None,
password: Optional[str] = None,
Expand Down Expand Up @@ -112,6 +113,7 @@ def run(

def checkout(
self,
*,
url: str,
revision: Union[RevisionLiteral, str] = None,
force: Optional[bool] = None,
Expand Down Expand Up @@ -159,6 +161,7 @@ def checkout(

def add(
self,
*,
path: Union[list[pathlib.Path], pathlib.Path],
targets: Optional[pathlib.Path] = None,
depth: DepthLiteral = None,
Expand Down Expand Up @@ -225,7 +228,6 @@ def auth(
self,
remove: Optional[str] = None,
show_passwords: Optional[bool] = None,
*args,
**kwargs,
):
"""
Expand All @@ -244,7 +246,7 @@ def auth(
>>> Svn(dir=tmp_path).auth()
"Credentials cache in '...' is empty"
"""
local_flags: list[str] = [*args]
local_flags: list[str] = []

if remove is not None:
local_flags.extend(["--remove", remove])
Expand All @@ -256,14 +258,14 @@ def auth(
def blame(
self,
target: pathlib.Path,
*,
revision: Union[RevisionLiteral, str] = None,
verbose: Optional[bool] = None,
force: Optional[bool] = None,
use_merge_history: Optional[bool] = None,
incremental: Optional[bool] = None,
xml: Optional[bool] = None,
extensions: Optional[str] = None,
*args,
**kwargs,
):
"""
Expand Down Expand Up @@ -304,7 +306,7 @@ def blame(
>>> svn.blame('new.txt')
'1 ... example text'
"""
local_flags: list[str] = [target, *args]
local_flags: list[str] = [str(target)]

if revision is not None:
local_flags.append(f"--revision={revision}")
Expand Down Expand Up @@ -361,6 +363,7 @@ def cleanup(self, *args, **kwargs):

def commit(
self,
*,
path: Union[list[pathlib.Path], pathlib.Path],
targets: Optional[pathlib.Path] = None,
message: Optional[str] = None,
Expand All @@ -371,7 +374,6 @@ def commit(
force_log: Optional[bool] = None,
keep_changelists: Optional[bool] = None,
include_externals: Optional[bool] = None,
*args,
**kwargs,
):
"""
Expand Down