Skip to content

Commit b63aae6

Browse files
authored
fix(cmd[hg,svn]): Fix argument flag passing (#365)
2 parents dc9f7f4 + 126cbf3 commit b63aae6

File tree

3 files changed

+18
-18
lines changed

3 files changed

+18
-18
lines changed

CHANGES

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ $ pip install --user --upgrade --pre libvcs
6565

6666
### Bug fixes
6767

68-
- Fix argument input for git commands, e.g. `git config --get color.diff` would not properly
69-
pass-through to subprocess. {issue}`360`
68+
- Fix argument input for commands, e.g. `git config --get color.diff` would not properly
69+
pass-through to subprocess. git: {issue}`360`, svn and hg: {issue}`365`
7070

7171
### Internals
7272

libvcs/cmd/hg.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -131,13 +131,13 @@ def run(
131131
kwargs["cwd"] = self.dir
132132

133133
if repository is not None:
134-
cli_args.append(f"--repository {repository}")
134+
cli_args.extend(["--repository", repository])
135135
if config is not None:
136-
cli_args.append("--config {config}")
136+
cli_args.extend(["--config", config])
137137
if pager is not None:
138-
cli_args.append(f"--pager {pager}")
138+
cli_args.append(["--pager", pager])
139139
if color is not None:
140-
cli_args.append(f"--color {color}")
140+
cli_args.append(["--color", color])
141141
if verbose is True:
142142
cli_args.append("verbose")
143143
if quiet is True:
@@ -189,13 +189,13 @@ def clone(
189189
local_flags: list[str] = []
190190

191191
if ssh is not None:
192-
local_flags.append(f"--ssh {ssh}")
192+
local_flags.extend(["--ssh", ssh])
193193
if remote_cmd is not None:
194-
local_flags.append(f"--remotecmd {remote_cmd}")
194+
local_flags.extend(["--remotecmd", remote_cmd])
195195
if rev is not None:
196-
local_flags.append(f"--rev {rev}")
196+
local_flags.extend(["--rev", rev])
197197
if branch is not None:
198-
local_flags.append(f"--branch {branch}")
198+
local_flags.extend(["--branch", branch])
199199
if no_update is True:
200200
local_flags.append("--noupdate")
201201
if pull is True:

libvcs/cmd/svn.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -98,15 +98,15 @@ def run(
9898
if non_interactive is True:
9999
cli_args.append("--non-interactive")
100100
if username is not None:
101-
cli_args.append(f"--username {username}")
101+
cli_args.extend(["--username", username])
102102
if password is not None:
103-
cli_args.append(f"--password {password}")
103+
cli_args.extend(["--password", password])
104104
if trust_server_cert is True:
105105
cli_args.append("--trust-server_cert")
106106
if config_dir is not None:
107-
cli_args.append("--config-dir {config_dir}")
107+
cli_args.extend(["--config-dir", str(config_dir)])
108108
if config_option is not None:
109-
cli_args.append("--config-option {config_option}")
109+
cli_args.extend(["--config-option", str(config_option)])
110110

111111
return run(args=cli_args, **kwargs)
112112

@@ -230,7 +230,7 @@ def auth(
230230
):
231231
"""
232232
Wraps `svn auth
233-
<https://svnbook.red-bean.com/en/1.7/svn.ref.svn.c.auth.html>`_.
233+
<https://subversion.apache.org/faq.html#plaintext-passwords>`_.
234234
235235
Parameters
236236
----------
@@ -247,7 +247,7 @@ def auth(
247247
local_flags: list[str] = [*args]
248248

249249
if remove is not None:
250-
local_flags.append(f"--remove {remove}")
250+
local_flags.extend(["--remove", remove])
251251
if show_passwords is True:
252252
local_flags.append("--show-passwords")
253253

@@ -317,7 +317,7 @@ def blame(
317317
if xml is True:
318318
local_flags.append("--xml")
319319
if extensions is not None:
320-
local_flags.append(f"--extensions {extensions}")
320+
local_flags.extend(["--extensions", extensions])
321321
if force is True:
322322
local_flags.append("--force")
323323

@@ -418,7 +418,7 @@ def commit(
418418
if no_unlock is True:
419419
local_flags.append("--no-unlock")
420420
if file is not None:
421-
local_flags.append(f"--file {file}")
421+
local_flags.extend(["--file", str(file)])
422422
if force_log is True:
423423
local_flags.append("--force")
424424
if include_externals is True:

0 commit comments

Comments
 (0)