comparison mercurial/branchmap.py @ 42138:caebe5e7f4bd

repoview: move subsettable in a dedicated module The dictionary got moved in `branchmap` to avoid import cycle. However, we are about to needs it in repoview too. So we introduce a now module to define that that mapping.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Fri, 12 Apr 2019 15:41:32 +0200
parents f0203c3406e7
children 07faf5c65190 09fd338522fa
comparison
equal deleted inserted replaced
42137:d086ba387ae8 42138:caebe5e7f4bd
21 pycompat, 21 pycompat,
22 scmutil, 22 scmutil,
23 util, 23 util,
24 ) 24 )
25 from .utils import ( 25 from .utils import (
26 repoviewutil,
26 stringutil, 27 stringutil,
27 ) 28 )
29
30 subsettable = repoviewutil. subsettable
28 31
29 calcsize = struct.calcsize 32 calcsize = struct.calcsize
30 pack_into = struct.pack_into 33 pack_into = struct.pack_into
31 unpack_from = struct.unpack_from 34 unpack_from = struct.unpack_from
32
33
34 ### Nearest subset relation
35 # Nearest subset of filter X is a filter Y so that:
36 # * Y is included in X,
37 # * X - Y is as small as possible.
38 # This create and ordering used for branchmap purpose.
39 # the ordering may be partial
40 subsettable = {None: 'visible',
41 'visible-hidden': 'visible',
42 'visible': 'served',
43 'served.hidden': 'served',
44 'served': 'immutable',
45 'immutable': 'base'}
46 35
47 36
48 class BranchMapCache(object): 37 class BranchMapCache(object):
49 """mapping of filtered views of repo with their branchcache""" 38 """mapping of filtered views of repo with their branchcache"""
50 def __init__(self): 39 def __init__(self):