Mercurial > hg
view tests/list-tree.py @ 38644:43d0619cec90
revlog: enforce chunk slicing down to a certain size
Limit maximum chunk size to 4x final size when reading a revision from a
revlog. We only apply this logic when the target size is known from the
revlog.
Ideally, revlog's delta chain would be written in a way that does not trigger
this extra slicing often. However, having this second guarantee that we won't
read unexpectedly large amounts of memory in all cases is important for the
future. Future delta chain building algorithms might have good reason to
create delta chain with such characteristics.
Including this code in core as soon as possible will make Mercurial 4.7
forward-compatible with such improvement.
author | Boris Feld <boris.feld@octobus.net> |
---|---|
date | Tue, 10 Jul 2018 12:20:57 +0200 |
parents | acff41957b34 |
children | 2372284d9457 |
line wrap: on
line source
from __future__ import ( absolute_import, print_function, ) import argparse import os ap = argparse.ArgumentParser() ap.add_argument('path', nargs='+') opts = ap.parse_args() def gather(): for p in opts.path: if not os.path.exists(p): return if os.path.isdir(p): yield p + os.path.sep for dirpath, dirs, files in os.walk(p): for d in dirs: yield os.path.join(dirpath, d) + os.path.sep for f in files: yield os.path.join(dirpath, f) else: yield p print('\n'.join(sorted(gather(), key=lambda x: x.replace(os.path.sep, '/'))))