Augie Fackler <augie@google.com> [Wed, 06 Nov 2019 15:42:12 -0500] rev 43485
match: suppress error about subscripting an exception
I get the sense I should file a bug about subscripting Exception subclasses.
Differential Revision: https://phab.mercurial-scm.org/D7286
Augie Fackler <augie@google.com> [Wed, 06 Nov 2019 15:35:44 -0500] rev 43484
vfs: more attribute suppressions
Differential Revision: https://phab.mercurial-scm.org/D7285
Augie Fackler <augie@google.com> [Wed, 06 Nov 2019 15:35:21 -0500] rev 43483
mdiff: mark diffopts as having dynamic attributes
This class looks like we could move it to being an attrs and life
would be better, but let's do that later.
Differential Revision: https://phab.mercurial-scm.org/D7284
Augie Fackler <augie@google.com> [Wed, 06 Nov 2019 15:29:08 -0500] rev 43482
vfs: suppress some pytype errors around us using a private attribute
Looking at threading._MainThread seems like we're probably a little
unsupported, but since this code appears to work on both Python 2 and
3 I'm not going to sweat this for now.
Differential Revision: https://phab.mercurial-scm.org/D7282
Augie Fackler <augie@google.com> [Wed, 06 Nov 2019 15:24:44 -0500] rev 43481
wireprototypes: disable pytype where it's just confused
By inspection validnames is always a Set[bytes] here, but for some
reason pytype is convinced it's a bytes. Let's disable the error for now.
Differential Revision: https://phab.mercurial-scm.org/D7281
Augie Fackler <augie@google.com> [Wed, 06 Nov 2019 15:16:04 -0500] rev 43480
scmposix: another suppression on IOError subscripting
As before, this will clear up when we move to Python 3-only.
Differential Revision: https://phab.mercurial-scm.org/D7280
Augie Fackler <augie@google.com> [Wed, 06 Nov 2019 15:15:42 -0500] rev 43479
pvec: add an explicit type hint to help pytype
Differential Revision: https://phab.mercurial-scm.org/D7279
Augie Fackler <augie@google.com> [Wed, 06 Nov 2019 15:12:46 -0500] rev 43478
procutil: suppress pytype warnings around windows-only attributes
Differential Revision: https://phab.mercurial-scm.org/D7278
Augie Fackler <augie@google.com> [Wed, 06 Nov 2019 15:03:02 -0500] rev 43477
posix: add a pytype suppression
This one seems a little sketchier than the others, but this will clean
up when we're Python 3-only.
Differential Revision: https://phab.mercurial-scm.org/D7276
Augie Fackler <augie@google.com> [Wed, 06 Nov 2019 14:48:22 -0500] rev 43476
color: suppress pytype warning on a windows-only module
Differential Revision: https://phab.mercurial-scm.org/D7274
Augie Fackler <augie@google.com> [Wed, 06 Nov 2019 14:20:27 -0500] rev 43475
compression: tell pytype to not sweat a missing `zstd` module
Differential Revision: https://phab.mercurial-scm.org/D7273
Augie Fackler <augie@google.com> [Wed, 06 Nov 2019 17:46:26 -0500] rev 43474
pytype: don't warn us about ignored-on-py3 metaclasses
We can remove this when we're Python 3-only, but for now it's just too
awkward to deal with and it's harmless.
Differential Revision: https://phab.mercurial-scm.org/D7272
Augie Fackler <augie@google.com> [Wed, 06 Nov 2019 14:12:53 -0500] rev 43473
linelog: be more careful about types before looking for _target attribute
Without this, pytype (correctly) complains that fakejge might not have
a _cmprev attribute. We're operating on some constraints not
expressible in the type system, so we detect the invalid case and
raise a nicer exception now.
Sadly, we also need an `assert` to give PyType a clue that we know
what we're doing, but I can absolutely live with that.
Differential Revision: https://phab.mercurial-scm.org/D7271
Augie Fackler <augie@google.com> [Wed, 06 Nov 2019 14:11:29 -0500] rev 43472
linelog: suppress annoying pytype warning about an ignored metaclass
This isn't actively hurting us right now, and it's not trivial to set
up this metaclass correctly on both Python 2 and Python 3 without
dragging in all of `six`, but we still get lots of typechecking
goodness with this error suppressed.
Differential Revision: https://phab.mercurial-scm.org/D7270
Augie Fackler <augie@google.com> [Wed, 06 Nov 2019 14:10:09 -0500] rev 43471
hgignore: ignore generated pytype stubs
Differential Revision: https://phab.mercurial-scm.org/D7269
Augie Fackler <augie@google.com> [Wed, 06 Nov 2019 14:09:36 -0500] rev 43470
hghave: add a check for pytype, Google's Python type checker
I'm not unbiased, but I strongly prefer pytype to mypy: it does more
inference, so we don't need as many annontations. In theory we can use
both, but since I'm doing some tinkering with pytype I figured I'd
just try setting it up.
Differential Revision: https://phab.mercurial-scm.org/D7268
Augie Fackler <augie@google.com> [Wed, 06 Nov 2019 15:13:23 -0500] rev 43469
encoding: define local identify functions with explicit type comments
This removes some obfuscation as far as pytype is concerned and
corrects many bogus type errors.
Differential Revision: https://phab.mercurial-scm.org/D7267
Augie Fackler <augie@google.com> [Wed, 06 Nov 2019 15:19:23 -0500] rev 43468
vfs: add NotImplementedError version of join
Again, this helps out pytype.
Differential Revision: https://phab.mercurial-scm.org/D7266
Augie Fackler <augie@google.com> [Wed, 06 Nov 2019 15:11:30 -0500] rev 43467
vfs: add a NotImplementedError implementation of __call__
This helps pytype considerably on this file.
Differential Revision: https://phab.mercurial-scm.org/D7265
Augie Fackler <augie@google.com> [Wed, 06 Nov 2019 15:19:56 -0500] rev 43466
vfs: fix erroneous bytes constants
Detected with pytype.
Differential Revision: https://phab.mercurial-scm.org/D7264
Augie Fackler <augie@google.com> [Wed, 06 Nov 2019 15:17:38 -0500] rev 43465
pvec: migrate to modern integer division
Detected with pytype.
Differential Revision: https://phab.mercurial-scm.org/D7263
Augie Fackler <augie@google.com> [Wed, 06 Nov 2019 17:46:12 -0500] rev 43464
templateutil: fix a missing ABCMeta assignment
Caught by pytype.
Differential Revision: https://phab.mercurial-scm.org/D7262
Augie Fackler <augie@google.com> [Wed, 06 Nov 2019 15:15:00 -0500] rev 43463
pvec: fix overlooked chr() call
Caught by pytype.
Differential Revision: https://phab.mercurial-scm.org/D7261
Augie Fackler <augie@google.com> [Wed, 06 Nov 2019 15:29:28 -0500] rev 43462
vfs: another bytes-str confusion on thread name
Differential Revision: https://phab.mercurial-scm.org/D7260
Augie Fackler <augie@google.com> [Wed, 06 Nov 2019 14:19:05 -0500] rev 43461
statprof: correctly always pass a str as the thread name
Caught by pytype.
Differential Revision: https://phab.mercurial-scm.org/D7259
Denis Laxalde <denis.laxalde@logilab.fr> [Wed, 06 Nov 2019 16:54:34 +0100] rev 43460
py3: fix handling of ctrl keys in crecord (
issue6213)
The "keypressed" value in handlekeypressed() is a key name obtained by
curses's getkey(); this can be a multibyte string for special keys
like CTRL keys. Calling curses.unctrl() with such a value fails on
Python 3 with a TypeError as described in
issue6213. (On Python 2, this
does not crash, but I'm not sure the result is correct, though it does
no matter here.)
So instead of calling unctrl(), we compare "keypressed" with the
expected "^L" obtained by curses.ascii.ctrl("L").
Denis Laxalde <denis.laxalde@logilab.fr> [Wed, 06 Nov 2019 16:53:01 +0100] rev 43459
py3: keep "keypressed" a native str in crecord
This will help in the next changeset by avoiding a decode step. Also,
the actual bytes conversion seems superfluous since values coming from
curses's getkey() will be a native string. As a consequence, we open the
"testcommands" file (used in test-interactive-curses.t) in text mode.
Denis Laxalde <denis.laxalde@logilab.fr> [Wed, 06 Nov 2019 17:12:13 +0100] rev 43458
py3: compare response of crecord's confirmationwindow with str
confirmationwindow() returns a native string, as a result of calling
chr() on getch(). On Python 3, response.lower().startswith(b"y") leads
to a TypeError.
This fixes a crash when typing "r" in the curses interface of
interactive commit.
Denis Laxalde <denis.laxalde@logilab.fr> [Thu, 07 Nov 2019 08:58:26 +0100] rev 43457
py3: compare http server's command with a native string
The "command" attribute is an str, so comparing with a bytes would not
work on Python 3. This might solve issues in test-lfs-serve-access.t
that happens sometimes (especially in CI):
--- /hgwork/src/tests/test-lfs-serve-access.t
+++ /hgwork/src/tests/test-lfs-serve-access.t.err
@@ -163,11 +163,13 @@
$ cat $TESTTMP/access.log $TESTTMP/errors.log
$LOCALIP - - [$LOGDATE$] "POST /missing/objects/batch HTTP/1.1" 404 - (glob)
+ $LOCALIP - - [05/Nov/2019 16:32:34] "{"objects": [{"oid": "
f03217a32529a28a42d03b1244fe09b6e0f9fd06d7b966d4d50567be2abe6c0e", "size": 20}], "operation": "download"}" HTTPStatus.BAD_REQUEST -
$LOCALIP - - [$LOGDATE$] "GET /subdir/mount/point?cmd=capabilities HTTP/1.1" 200 - (glob)
$LOCALIP - - [$LOGDATE$] "GET /subdir/mount/point?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
$LOCALIP - - [$LOGDATE$] "GET /subdir/mount/point?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bookmarks=1&bundlecaps=HG20%2Cbundle2%3DHG20%250Abookmarks%250Achangegroup%253D01%252C02%252C03%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Aphases%253Dheads%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps%250Arev-branch-cache%250Astream%253Dv2&cg=1&common=
0000000000000000000000000000000000000000&heads=
525251863cad618e55d483555f3d00a2ca99597e&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
$LOCALIP - - [$LOGDATE$] "POST /subdir/mount/point/.git/info/lfs/objects/batch HTTP/1.1" 200 - (glob)
$LOCALIP - - [$LOGDATE$] "GET /subdir/mount/point/.hg/lfs/objects/
f03217a32529a28a42d03b1244fe09b6e0f9fd06d7b966d4d50567be2abe6c0e HTTP/1.1" 200 - (glob)
+ $LOCALIP - - [05/Nov/2019 16:32:34] code 400, message Bad request version ('"download"}')
Blobs that already exist in the usercache are linked into the repo store, even
though the client doesn't send the blob.
@@ -195,6 +197,7 @@
server2/.hg/store/lfs/objects/f0/
3217a32529a28a42d03b1244fe09b6e0f9fd06d7b966d4d50567be2abe6c0e
$ "$PYTHON" $RUNTESTDIR/killdaemons.py $DAEMON_PIDS
$ cat $TESTTMP/errors.log
+ $LOCALIP - - [05/Nov/2019 16:32:34] code 400, message Bad request version ('"download"}')
$ cat >> $TESTTMP/lfsstoreerror.py <<EOF
> import errno
(from https://ci.hg.gregoryszorc.com/job-info/hg-committed-
ca3dca416f8d5863ca6f5a4a6a6bb835dcd5feeb-debian10-cpython-3.7-0)
Raphaël Gomès <rgomes@octobus.net> [Wed, 06 Nov 2019 13:46:16 +0100] rev 43456
rust-status: remove dead code
The `walk_explicit` function is only called when using a prefix matcher, which
the Rust code does not yet support. This function will return in a future
patch, probably with a different signature for performance reasons.
With it, the `files` argument and its interface code can be removed for now.
Differential Revision: https://phab.mercurial-scm.org/D7253