##// END OF EJS Templates
dirstate: Remove the Rust abstraction DirstateMapMethods...
dirstate: Remove the Rust abstraction DirstateMapMethods This Rust trait used to exist in order to allow the DirstateMap class exposed to Python to be backed by either of two implementations: one similar to the Python implementation based on a "flat" `HashMap<HgPathBuf, DirstateEntry>`, and the newer one based on a tree of nodes matching the directory structure of tracked files. A boxed trait object was used with dynamic dispatch. With the flat implementation removed and only the tree one remaining, this abstraction is not useful anymore and the concrete type can be stored directly. It remains that the trait was implemented separately for `DirstateMap<'_>` (which takes a lifetime parameter) and `OwningDirstateMap` (whose job is to wrap the former and hide the lifetime parameter), with the latter impl only forwarding calls. This changeset also removes this forwarding. Instead, the methods formerly of the `DirstateMapMethods` trait are now inherent methods implemented for `OwningDirstateMap` (where they will actually be used) but in the module that defines `DirstateMap`. This unusual setup gives access to the private fields of `DirstateMap` from those methods. Differential Revision: https://phab.mercurial-scm.org/D11517

File last commit:

r45508:9bedcfb4 default
r48883:3d0a9c6e default
Show More
manifest_corpus.py
38 lines | 1.4 KiB | text/x-python | PythonLexer
/ contrib / fuzz / manifest_corpus.py
Augie Fackler
fuzz: new fuzzer for cext/manifest.c...
r40089 from __future__ import absolute_import, print_function
import argparse
import zipfile
ap = argparse.ArgumentParser()
ap.add_argument("out", metavar="some.zip", type=str, nargs=1)
args = ap.parse_args()
with zipfile.ZipFile(args.out[0], "w", zipfile.ZIP_STORED) as zf:
Augie Fackler
formatting: blacken the codebase...
r43346 zf.writestr(
"manifest_zero",
Augie Fackler
fuzz: tell manifest fuzzer about longer node hashes...
r45519 '''\0PKG-INFO\09b3ed8f2b81095a13064402e930565f083346e9a
Augie Fackler
fuzz: new fuzzer for cext/manifest.c...
r40089 README\080b6e76643dcb44d4bc729e932fc464b3e36dbe3
hg\0b6444347c629cc058d478023905cfb83b7f5bb9d
mercurial/__init__.py\0b80de5d138758541c5f05265ad144ab9fa86d1db
mercurial/byterange.py\017f5a9fbd99622f31a392c33ac1e903925dc80ed
mercurial/fancyopts.py\0b6f52e23e356748c5039313d8b639cda16bf67ba
mercurial/hg.py\023cc12f225f1b42f32dc0d897a4f95a38ddc8f4a
mercurial/mdiff.py\0a05f65c44bfbeec6a42336cd2ff0b30217899ca3
mercurial/revlog.py\0217bc3fde6d82c0210cf56aeae11d05a03f35b2b
mercurial/transaction.py\09d180df101dc14ce3dd582fd998b36c98b3e39aa
notes.txt\0703afcec5edb749cf5cec67831f554d6da13f2fb
setup.py\0ccf3f6daf0f13101ca73631f7a1769e328b472c9
tkmerge\03c922edb43a9c143682f7bc7b00f98b3c756ebe7
Augie Fackler
formatting: blacken the codebase...
r43346 ''',
)
Augie Fackler
fuzz: tell manifest fuzzer about longer node hashes...
r45519 zf.writestr("badmanifest_shorthashes", "\0narf\0aa\nnarf2\0aaa\n")
Augie Fackler
formatting: blacken the codebase...
r43346 zf.writestr(
"badmanifest_nonull",
Augie Fackler
fuzz: tell manifest fuzzer about longer node hashes...
r45519 "\0narf\0cccccccccccccccccccccccccccccccccccccccc\n"
Augie Fackler
formatting: blacken the codebase...
r43346 "narf2aaaaaaaaaaaaaaaaaaaa\n",
)
Augie Fackler
fuzz: tell manifest fuzzer about longer node hashes...
r45519
zf.writestr(
"manifest_long_nodes",
"\1a\0ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\n",
)