12 import struct |
12 import struct |
13 |
13 |
14 from .node import nullrev |
14 from .node import nullrev |
15 from . import ( |
15 from . import ( |
16 error, |
16 error, |
17 requirements as requirementsmod, |
|
18 util, |
17 util, |
19 ) |
18 ) |
20 |
19 |
21 from .revlogutils import ( |
20 from .revlogutils import ( |
22 constants as revlogconst, |
|
23 flagutil as sidedataflag, |
21 flagutil as sidedataflag, |
24 sidedata as sidedatamod, |
22 sidedata as sidedatamod, |
25 ) |
23 ) |
26 |
24 |
27 |
25 |
822 sidedata, has_copies_info = _getsidedata(repo, rev) |
820 sidedata, has_copies_info = _getsidedata(repo, rev) |
823 flags_to_add = sidedataflag.REVIDX_HASCOPIESINFO if has_copies_info else 0 |
821 flags_to_add = sidedataflag.REVIDX_HASCOPIESINFO if has_copies_info else 0 |
824 return sidedata, (flags_to_add, 0) |
822 return sidedata, (flags_to_add, 0) |
825 |
823 |
826 |
824 |
827 def set_sidedata_spec_for_repo(repo): |
|
828 if requirementsmod.COPIESSDC_REQUIREMENT in repo.requirements: |
|
829 repo.register_wanted_sidedata(sidedatamod.SD_FILES) |
|
830 repo.register_sidedata_computer( |
|
831 revlogconst.KIND_CHANGELOG, |
|
832 sidedatamod.SD_FILES, |
|
833 (sidedatamod.SD_FILES,), |
|
834 copies_sidedata_computer, |
|
835 sidedataflag.REVIDX_HASCOPIESINFO, |
|
836 ) |
|
837 |
|
838 |
|
839 def _sidedata_worker(srcrepo, revs_queue, sidedata_queue, tokens): |
825 def _sidedata_worker(srcrepo, revs_queue, sidedata_queue, tokens): |
840 """The function used by worker precomputing sidedata |
826 """The function used by worker precomputing sidedata |
841 |
827 |
842 It read an input queue containing revision numbers |
828 It read an input queue containing revision numbers |
843 It write in an output queue containing (rev, <sidedata-map>) |
829 It write in an output queue containing (rev, <sidedata-map>) |