|
11 | 11 | from typing import Callable
|
12 | 12 | from typing import TYPE_CHECKING
|
13 | 13 |
|
14 |
| -from . import _types as _t |
15 | 14 | from .config import Configuration
|
16 | 15 | from .scm_workdir import Workdir
|
| 16 | +from .utils import _CmdResult |
17 | 17 | from .utils import data_from_mime
|
18 | 18 | from .utils import do_ex
|
19 | 19 | from .utils import require_command
|
|
23 | 23 | from .version import tags_to_versions
|
24 | 24 |
|
25 | 25 | if TYPE_CHECKING:
|
| 26 | + from . import _types as _t |
| 27 | + |
26 | 28 | from setuptools_scm.hg_git import GitWorkdirHgClient
|
27 | 29 |
|
28 | 30 | REF_TAG_RE = re.compile(r"(?<=\btag: )([^,]+)\b")
|
@@ -72,7 +74,7 @@ def from_potential_worktree(cls, wd: _t.PathT) -> GitWorkdir | None:
|
72 | 74 |
|
73 | 75 | return cls(real_wd)
|
74 | 76 |
|
75 |
| - def do_ex_git(self, cmd: list[str]) -> _t.CmdResult: |
| 77 | + def do_ex_git(self, cmd: list[str]) -> _CmdResult: |
76 | 78 | return self.do_ex(["git", "--git-dir", join(self.path, ".git")] + cmd)
|
77 | 79 |
|
78 | 80 | def is_dirty(self) -> bool:
|
@@ -120,7 +122,7 @@ def count_all_nodes(self) -> int:
|
120 | 122 | revs, _, _ = self.do_ex_git(["rev-list", "HEAD"])
|
121 | 123 | return revs.count("\n") + 1
|
122 | 124 |
|
123 |
| - def default_describe(self) -> _t.CmdResult: |
| 125 | + def default_describe(self) -> _CmdResult: |
124 | 126 | git_dir = join(self.path, ".git")
|
125 | 127 | return self.do_ex(
|
126 | 128 | DEFAULT_DESCRIBE[:1] + ["--git-dir", git_dir] + DEFAULT_DESCRIBE[1:]
|
|
0 commit comments