comparison mercurial/revlogutils/flagutil.py @ 42728:ca5ca3badd3c

flagutil: create a `mercurial.revlogutils.flagutil` module The flagprocessings logic is duplicated in 2 extra places, and usually in a less robust flavor. This is a maintenance nightmare that I would like to see cleaned up. To do so I am creating a `flagutil` module to move flag processings related code and make it easily reusable by other code.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Thu, 08 Aug 2019 01:03:01 +0200
parents
children 05c80f9ef100
comparison
equal deleted inserted replaced
42727:bbe71b5afd02 42728:ca5ca3badd3c
1 # flagutils.py - code to deal with revlog flags and their processors
2 #
3 # Copyright 2016 Remi Chaintron <remi@fb.com>
4 # Copyright 2016-2019 Pierre-Yves David <pierre-yves.david@ens-lyon.org>
5 #
6 # This software may be used and distributed according to the terms of the
7 # GNU General Public License version 2 or any later version.
8
9 from __future__ import absolute_import
10
11 from .constants import (
12 REVIDX_DEFAULT_FLAGS,
13 REVIDX_ELLIPSIS,
14 REVIDX_EXTSTORED,
15 REVIDX_FLAGS_ORDER,
16 REVIDX_ISCENSORED,
17 REVIDX_KNOWN_FLAGS,
18 REVIDX_RAWTEXT_CHANGING_FLAGS,
19 )
20
21 # blanked usage of all the name to prevent pyflakes constraints
22 # We need these name available in the module for extensions.
23 REVIDX_ISCENSORED
24 REVIDX_ELLIPSIS
25 REVIDX_EXTSTORED
26 REVIDX_DEFAULT_FLAGS
27 REVIDX_FLAGS_ORDER
28 REVIDX_KNOWN_FLAGS
29 REVIDX_RAWTEXT_CHANGING_FLAGS
30
31