Show More
@@ -2,12 +2,24 | |||||
2 |
|
2 | |||
3 | from __future__ import annotations |
|
3 | from __future__ import annotations | |
4 |
|
4 | |||
|
5 | import typing | |||
|
6 | ||||
|
7 | from typing import ( | |||
|
8 | Any, | |||
|
9 | Tuple, | |||
|
10 | ) | |||
|
11 | ||||
5 | from ..i18n import _ |
|
12 | from ..i18n import _ | |
6 |
|
13 | |||
7 | from .. import cmdutil, error, logcmdutil, merge as mergemod, state as statemod |
|
14 | from .. import cmdutil, error, logcmdutil, merge as mergemod, state as statemod | |
8 |
|
15 | |||
9 |
|
16 | |||
10 | def cmd_graft(ui, repo, *revs, **opts): |
|
17 | if typing.TYPE_CHECKING: | |
|
18 | _ActionT = str | |||
|
19 | _CmdArgsT = Any # TODO: (statedata, revs, editor, cont, dry_run, tool) | |||
|
20 | ||||
|
21 | ||||
|
22 | def cmd_graft(ui, repo, *revs, **opts) -> int: | |||
11 | """implement the graft command as defined in mercurial/commands.py""" |
|
23 | """implement the graft command as defined in mercurial/commands.py""" | |
12 | ret = _process_args(ui, repo, *revs, **opts) |
|
24 | ret = _process_args(ui, repo, *revs, **opts) | |
13 | action, graftstate, args = ret |
|
25 | action, graftstate, args = ret | |
@@ -25,7 +37,9 def cmd_graft(ui, repo, *revs, **opts): | |||||
25 | raise error.ProgrammingError('unknown action: %s' % action) |
|
37 | raise error.ProgrammingError('unknown action: %s' % action) | |
26 |
|
38 | |||
27 |
|
39 | |||
28 | def _process_args(ui, repo, *revs, **opts): |
|
40 | def _process_args( | |
|
41 | ui, repo, *revs, **opts | |||
|
42 | ) -> Tuple[_ActionT, statemod.cmdstate | None, _CmdArgsT | None]: | |||
29 | """process the graft command argument to figure out what to do |
|
43 | """process the graft command argument to figure out what to do | |
30 |
|
44 | |||
31 | This also filter the selected revision to skip the one that cannot be graft |
|
45 | This also filter the selected revision to skip the one that cannot be graft |
General Comments 0
You need to be logged in to leave comments.
Login now