[Updated] D10236: commands: necessary annotations and assertions to pass pytype
mharbison72 (Matt Harbison)
phabricator at mercurial-scm.org
Mon Mar 22 18:29:53 UTC 2021
Closed by commit rHGb26f9560f40d: commands: necessary annotations and assertions to pass pytype (authored by mharbison72).
This revision was automatically updated to reflect the committed changes.
This revision was not accepted when it landed; it landed in state "Needs Review".
REPOSITORY
rHG Mercurial
CHANGES SINCE LAST UPDATE
https://phab.mercurial-scm.org/D10236?vs=26511&id=26542
CHANGES SINCE LAST ACTION
https://phab.mercurial-scm.org/D10236/new/
REVISION DETAIL
https://phab.mercurial-scm.org/D10236
AFFECTED FILES
mercurial/commands.py
CHANGE DETAILS
diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -76,6 +76,12 @@
stringutil,
)
+if pycompat.TYPE_CHECKING:
+ from typing import (
+ List,
+ )
+
+
table = {}
table.update(debugcommandsmod.command._table)
@@ -3295,7 +3301,8 @@
)
# checking that newnodes exist because old state files won't have it
elif statedata.get(b'newnodes') is not None:
- statedata[b'newnodes'].append(node)
+ nn = statedata[b'newnodes'] # type: List[bytes]
+ nn.append(node)
# remove state when we complete successfully
if not opts.get(b'dry_run'):
@@ -7268,6 +7275,12 @@
dest = dbranch = dother = outgoing = None
if opts.get(b'remote'):
+ # Help pytype. --remote sets both `needsincoming` and `needsoutgoing`.
+ # The former always sets `sother` (or raises an exception if it can't);
+ # the latter always sets `outgoing`.
+ assert sother is not None
+ assert outgoing is not None
+
t = []
if incoming:
t.append(_(b'1 or more incoming'))
To: mharbison72, #hg-reviewers
Cc: mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-patches/attachments/20210322/a3f251c3/attachment-0002.html>
More information about the Mercurial-patches
mailing list