Details
Details
- Reviewers
pulkit - Group Reviewers
hg-reviewers - Commits
- rHGc891a11ffe27: basepack: avoid 'rbe' mode in Python 3
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Lint Skipped - Unit
Unit Tests Skipped
pulkit |
hg-reviewers |
Lint Skipped |
Unit Tests Skipped |
Path | Packages | |||
---|---|---|---|---|
M | hgext/remotefilelog/basepack.py (3 lines) |
Commit | Parents | Author | Summary | Date |
---|---|---|---|---|
Augie Fackler | Jan 16 2019, 10:56 AM |
# 10 step fanout scan = 2^16 / (2^16 / 8) # fanout space divided by entries | # 10 step fanout scan = 2^16 / (2^16 / 8) # fanout space divided by entries | ||||
SMALLFANOUTCUTOFF = 2**16 // 8 | SMALLFANOUTCUTOFF = 2**16 // 8 | ||||
# The amount of time to wait between checking for new packs. This prevents an | # The amount of time to wait between checking for new packs. This prevents an | ||||
# exception when data is moved to a new pack after the process has already | # exception when data is moved to a new pack after the process has already | ||||
# loaded the pack list. | # loaded the pack list. | ||||
REFRESHRATE = 0.1 | REFRESHRATE = 0.1 | ||||
if pycompat.isposix: | if pycompat.isposix and not pycompat.ispy3: | ||||
# With glibc 2.7+ the 'e' flag uses O_CLOEXEC when opening. | # With glibc 2.7+ the 'e' flag uses O_CLOEXEC when opening. | ||||
# The 'e' flag will be ignored on older versions of glibc. | # The 'e' flag will be ignored on older versions of glibc. | ||||
# Python 3 can't handle the 'e' flag. | |||||
PACKOPENMODE = 'rbe' | PACKOPENMODE = 'rbe' | ||||
else: | else: | ||||
PACKOPENMODE = 'rb' | PACKOPENMODE = 'rb' | ||||
class _cachebackedpacks(object): | class _cachebackedpacks(object): | ||||
def __init__(self, packs, cachesize): | def __init__(self, packs, cachesize): | ||||
self._packs = set(packs) | self._packs = set(packs) | ||||
self._lrucache = util.lrucachedict(cachesize) | self._lrucache = util.lrucachedict(cachesize) |