##// END OF EJS Templates
dirstate: add some traces on listdir calls...
dirstate: add some traces on listdir calls I'm starting to spend some time trying to make `hg status` do less work, and knowing what's happening in here and what's expensive is an important start. Differential Revision: https://phab.mercurial-scm.org/D7109

File last commit:

r43346:2372284d default
r43514:fbc1c6bb default
Show More
dirstate_corpus.py
17 lines | 529 B | text/x-python | PythonLexer
/ contrib / fuzz / dirstate_corpus.py
Augie Fackler
fuzz: new fuzzer for dirstate parser...
r41051 from __future__ import absolute_import, print_function
import argparse
import os
import zipfile
ap = argparse.ArgumentParser()
ap.add_argument("out", metavar="some.zip", type=str, nargs=1)
args = ap.parse_args()
Augie Fackler
formatting: blacken the codebase...
r43346 reporoot = os.path.normpath(os.path.join(os.path.dirname(__file__), '..', '..'))
Augie Fackler
fuzz: new fuzzer for dirstate parser...
r41051 dirstate = os.path.join(reporoot, '.hg', 'dirstate')
with zipfile.ZipFile(args.out[0], "w", zipfile.ZIP_STORED) as zf:
if os.path.exists(dirstate):
with open(dirstate) as f:
zf.writestr("dirstate", f.read())