annotate tests/test-debug-rebuild-dirstate.t @ 51721:ed28085827ec

typing: explicitly type some `mercurial.util` eol code to avoid @overload Unlike the previous commit, this makes a material difference in the generated stub file- the `pycompat.identity()` aliases generated an @overload like this: @overload def fromnativeeol(a: _T0) -> _T0: ... ... which might fail to detect a bad argument, like str. This drops the @overload for the 3 related methods, so there's a single definition for each. The `typelib.BinaryIO_Proxy` is used for subclassing (the same as was done in 8147abc05794), so that it is a `BinaryIO` type during type checking, but still inherits `object` at runtime. That way, we don't need to implement unused abstract methods.
author Matt Harbison <matt_harbison@yahoo.com>
date Fri, 19 Jul 2024 16:49:46 -0400
parents dcaa2df1f688
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
50724
a10d823a8e3d dirstate: avoid leaking disk space in `hg debugrebuilddirstate`
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents:
diff changeset
1 #require rust
a10d823a8e3d dirstate: avoid leaking disk space in `hg debugrebuilddirstate`
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents:
diff changeset
2
a10d823a8e3d dirstate: avoid leaking disk space in `hg debugrebuilddirstate`
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents:
diff changeset
3 $ cat >> $HGRCPATH << EOF
a10d823a8e3d dirstate: avoid leaking disk space in `hg debugrebuilddirstate`
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents:
diff changeset
4 > [format]
a10d823a8e3d dirstate: avoid leaking disk space in `hg debugrebuilddirstate`
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents:
diff changeset
5 > use-dirstate-v2=1
a10d823a8e3d dirstate: avoid leaking disk space in `hg debugrebuilddirstate`
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents:
diff changeset
6 > [storage]
a10d823a8e3d dirstate: avoid leaking disk space in `hg debugrebuilddirstate`
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents:
diff changeset
7 > dirstate-v2.slow-path=allow
a10d823a8e3d dirstate: avoid leaking disk space in `hg debugrebuilddirstate`
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents:
diff changeset
8 > EOF
a10d823a8e3d dirstate: avoid leaking disk space in `hg debugrebuilddirstate`
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents:
diff changeset
9
a10d823a8e3d dirstate: avoid leaking disk space in `hg debugrebuilddirstate`
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents:
diff changeset
10 $ hg init t
a10d823a8e3d dirstate: avoid leaking disk space in `hg debugrebuilddirstate`
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents:
diff changeset
11 $ cd t
a10d823a8e3d dirstate: avoid leaking disk space in `hg debugrebuilddirstate`
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents:
diff changeset
12
a10d823a8e3d dirstate: avoid leaking disk space in `hg debugrebuilddirstate`
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents:
diff changeset
13 $ for i in 1 2 3 4 5 6 7 8 9 10; do touch foobar$i; done
a10d823a8e3d dirstate: avoid leaking disk space in `hg debugrebuilddirstate`
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents:
diff changeset
14 $ hg add .
a10d823a8e3d dirstate: avoid leaking disk space in `hg debugrebuilddirstate`
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents:
diff changeset
15 adding foobar1
a10d823a8e3d dirstate: avoid leaking disk space in `hg debugrebuilddirstate`
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents:
diff changeset
16 adding foobar10
a10d823a8e3d dirstate: avoid leaking disk space in `hg debugrebuilddirstate`
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents:
diff changeset
17 adding foobar2
a10d823a8e3d dirstate: avoid leaking disk space in `hg debugrebuilddirstate`
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents:
diff changeset
18 adding foobar3
a10d823a8e3d dirstate: avoid leaking disk space in `hg debugrebuilddirstate`
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents:
diff changeset
19 adding foobar4
a10d823a8e3d dirstate: avoid leaking disk space in `hg debugrebuilddirstate`
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents:
diff changeset
20 adding foobar5
a10d823a8e3d dirstate: avoid leaking disk space in `hg debugrebuilddirstate`
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents:
diff changeset
21 adding foobar6
a10d823a8e3d dirstate: avoid leaking disk space in `hg debugrebuilddirstate`
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents:
diff changeset
22 adding foobar7
a10d823a8e3d dirstate: avoid leaking disk space in `hg debugrebuilddirstate`
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents:
diff changeset
23 adding foobar8
a10d823a8e3d dirstate: avoid leaking disk space in `hg debugrebuilddirstate`
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents:
diff changeset
24 adding foobar9
a10d823a8e3d dirstate: avoid leaking disk space in `hg debugrebuilddirstate`
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents:
diff changeset
25 $ hg commit -m "1"
a10d823a8e3d dirstate: avoid leaking disk space in `hg debugrebuilddirstate`
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents:
diff changeset
26
a10d823a8e3d dirstate: avoid leaking disk space in `hg debugrebuilddirstate`
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents:
diff changeset
27 Check that there's no space leak on debugrebuilddirstate
a10d823a8e3d dirstate: avoid leaking disk space in `hg debugrebuilddirstate`
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents:
diff changeset
28
a10d823a8e3d dirstate: avoid leaking disk space in `hg debugrebuilddirstate`
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents:
diff changeset
29 $ f --size .hg/dirstate*
a10d823a8e3d dirstate: avoid leaking disk space in `hg debugrebuilddirstate`
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents:
diff changeset
30 .hg/dirstate: size=133
a10d823a8e3d dirstate: avoid leaking disk space in `hg debugrebuilddirstate`
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents:
diff changeset
31 .hg/dirstate.88698448: size=511
a10d823a8e3d dirstate: avoid leaking disk space in `hg debugrebuilddirstate`
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents:
diff changeset
32 $ hg debugrebuilddirstate
a10d823a8e3d dirstate: avoid leaking disk space in `hg debugrebuilddirstate`
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents:
diff changeset
33 $ f --size .hg/dirstate*
a10d823a8e3d dirstate: avoid leaking disk space in `hg debugrebuilddirstate`
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents:
diff changeset
34 .hg/dirstate: size=133
a10d823a8e3d dirstate: avoid leaking disk space in `hg debugrebuilddirstate`
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents:
diff changeset
35 .hg/dirstate.6b8ab34b: size=511
51181
dcaa2df1f688 changelog: never inline changelog
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50724
diff changeset
36 $ hg debugrebuilddirstate
dcaa2df1f688 changelog: never inline changelog
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50724
diff changeset
37 $ f --size .hg/dirstate*
dcaa2df1f688 changelog: never inline changelog
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50724
diff changeset
38 .hg/dirstate: size=133
dcaa2df1f688 changelog: never inline changelog
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 50724
diff changeset
39 .hg/dirstate.b875dfc5: size=511