Skip to content

Commit f3be9f7

Browse files
committed
chore: pass list instead of string to _run()
This makes it consistent with the other invocations in this file and makes it easier to parametrize the Mercurial command in the future.
1 parent 0b14913 commit f3be9f7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/setuptools_scm/hg_git.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ def get_branch(self) -> str | None:
4242
return res.stdout
4343

4444
def get_head_date(self) -> date | None:
45-
return _run('hg log -r . -T "{shortdate(date)}"', cwd=self.path).parse_success(
46-
parse=date.fromisoformat, error_msg="head date err"
47-
)
45+
return _run(
46+
["hg", "log", "-r", ".", "-T", "{shortdate(date)}"], cwd=self.path
47+
).parse_success(parse=date.fromisoformat, error_msg="head date err")
4848

4949
def is_shallow(self) -> bool:
5050
return False
@@ -53,7 +53,7 @@ def fetch_shallow(self) -> None:
5353
pass
5454

5555
def get_hg_node(self) -> str | None:
56-
res = _run('hg log -r . -T "{node}"', cwd=self.path)
56+
res = _run(["hg", "log", "-r", ".", "-T", "{node}"], cwd=self.path)
5757
if res.returncode:
5858
return None
5959
else:

0 commit comments

Comments
 (0)