tests/testlib/ext-sidedata-5.py
changeset 47073 64cd1496bb70
parent 46718 ba8e508a8e69
child 47078 223b47235d1c
equal deleted inserted replaced
47072:4c041c71ec01 47073:64cd1496bb70
    19     revlog,
    19     revlog,
    20 )
    20 )
    21 
    21 
    22 
    22 
    23 from mercurial.revlogutils import sidedata as sidedatamod
    23 from mercurial.revlogutils import sidedata as sidedatamod
       
    24 from mercurial.revlogutils import constants
    24 
    25 
    25 
    26 
    26 def compute_sidedata_1(repo, revlog, rev, sidedata, text=None):
    27 def compute_sidedata_1(repo, revlog, rev, sidedata, text=None):
    27     sidedata = sidedata.copy()
    28     sidedata = sidedata.copy()
    28     if text is None:
    29     if text is None:
    40     return sidedata
    41     return sidedata
    41 
    42 
    42 
    43 
    43 def reposetup(ui, repo):
    44 def reposetup(ui, repo):
    44     # Sidedata keys happen to be the same as the categories, easier for testing.
    45     # Sidedata keys happen to be the same as the categories, easier for testing.
    45     for kind in (b'changelog', b'manifest', b'filelog'):
    46     for kind in constants.ALL_KINDS:
    46         repo.register_sidedata_computer(
    47         repo.register_sidedata_computer(
    47             kind,
    48             kind,
    48             sidedatamod.SD_TEST1,
    49             sidedatamod.SD_TEST1,
    49             (sidedatamod.SD_TEST1,),
    50             (sidedatamod.SD_TEST1,),
    50             compute_sidedata_1,
    51             compute_sidedata_1,