annotate tests/test-debug-rebuild-dirstate.t @ 51168:a9e00554b3e4 stable

procutil: move stdin assignment outside of try-finally block There is an stdin variable in the global scope of this module. And in the `finally` block of this try-finally statement we're checking `if stdin is not None`. Let's make sure we don't confuse code check tools into thinking we want to use global stdin by moving this line of code outside of `try`. This was caught by pytype 2023.11.21 on Python 3.11.2.
author Anton Shestakov <av6@dwimlabs.net>
date Sat, 02 Dec 2023 15:10:28 -0300
parents a10d823a8e3d
children dcaa2df1f688
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.b870a51b: 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.88698448: size=511
a10d823a8e3d dirstate: avoid leaking disk space in `hg debugrebuilddirstate`
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents:
diff changeset
36 $ hg debugrebuilddirstate
a10d823a8e3d dirstate: avoid leaking disk space in `hg debugrebuilddirstate`
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents:
diff changeset
37 $ f --size .hg/dirstate*
a10d823a8e3d dirstate: avoid leaking disk space in `hg debugrebuilddirstate`
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents:
diff changeset
38 .hg/dirstate: size=133
a10d823a8e3d dirstate: avoid leaking disk space in `hg debugrebuilddirstate`
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents:
diff changeset
39 .hg/dirstate.6b8ab34b: size=511