annotate tests/test-censor2.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 ceeb8fa23cc8
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
49165
72936be2a21b censor: demonstrate a bug
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents:
diff changeset
1 $ cat >> $HGRCPATH <<EOF
72936be2a21b censor: demonstrate a bug
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents:
diff changeset
2 > [censor]
72936be2a21b censor: demonstrate a bug
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents:
diff changeset
3 > policy=ignore
72936be2a21b censor: demonstrate a bug
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents:
diff changeset
4 > EOF
72936be2a21b censor: demonstrate a bug
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents:
diff changeset
5
72936be2a21b censor: demonstrate a bug
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents:
diff changeset
6 $ mkdir r
72936be2a21b censor: demonstrate a bug
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents:
diff changeset
7 $ cd r
72936be2a21b censor: demonstrate a bug
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents:
diff changeset
8 $ hg init
72936be2a21b censor: demonstrate a bug
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents:
diff changeset
9 $ echo secret > target
72936be2a21b censor: demonstrate a bug
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents:
diff changeset
10 $ hg commit -Am "secret"
72936be2a21b censor: demonstrate a bug
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents:
diff changeset
11 adding target
72936be2a21b censor: demonstrate a bug
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents:
diff changeset
12 $ touch bystander
72936be2a21b censor: demonstrate a bug
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents:
diff changeset
13 $ hg commit -Am "innocent"
72936be2a21b censor: demonstrate a bug
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents:
diff changeset
14 adding bystander
72936be2a21b censor: demonstrate a bug
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents:
diff changeset
15 $ echo erased-secret > target
72936be2a21b censor: demonstrate a bug
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents:
diff changeset
16 $ hg commit -m "erased secret"
72936be2a21b censor: demonstrate a bug
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents:
diff changeset
17 $ hg censor target --config extensions.censor= -r ".^^"
51267
195ab99cf791 censor: inform the user that we are spending time checking heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 49166
diff changeset
18 checking for the censored content in 1 heads
51269
db121ddd171e censor: be more verbose about the other steps too
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 51267
diff changeset
19 checking for the censored content in the working directory
51270
ceeb8fa23cc8 censor: accept multiple revision in a single call
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 51269
diff changeset
20 censoring 1 file revisions
49165
72936be2a21b censor: demonstrate a bug
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents:
diff changeset
21 $ hg update ".^"
72936be2a21b censor: demonstrate a bug
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents:
diff changeset
22 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
72936be2a21b censor: demonstrate a bug
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents:
diff changeset
23 $ cat target
72936be2a21b censor: demonstrate a bug
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents:
diff changeset
24 $ hg update tip
49166
77b5a190571c censor: fix [hg update] away from a revision with censored files
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 49165
diff changeset
25 1 files updated, 0 files merged, 0 files removed, 0 files unresolved