constants.py
43 lines
| 1002 B
| text/x-python
|
PythonLexer
Matt Harbison
|
r52756 | from __future__ import annotations | ||
Augie Fackler
|
r40530 | import struct | ||
from mercurial.i18n import _ | ||||
Augie Fackler
|
r43347 | NETWORK_CAP_LEGACY_SSH_GETFILES = b'exp-remotefilelog-ssh-getfiles-1' | ||
Augie Fackler
|
r40530 | |||
Augie Fackler
|
r43347 | SHALLOWREPO_REQUIREMENT = b"exp-remotefilelog-repo-req-1" | ||
Augie Fackler
|
r40543 | |||
Augie Fackler
|
r43347 | BUNDLE2_CAPABLITY = b"exp-remotefilelog-b2cap-1" | ||
Augie Fackler
|
r40544 | |||
Augie Fackler
|
r43347 | FILENAMESTRUCT = b'!H' | ||
Augie Fackler
|
r40530 | FILENAMESIZE = struct.calcsize(FILENAMESTRUCT) | ||
NODESIZE = 20 | ||||
Augie Fackler
|
r43347 | PACKREQUESTCOUNTSTRUCT = b'!I' | ||
Augie Fackler
|
r40530 | |||
Augie Fackler
|
r43347 | NODECOUNTSTRUCT = b'!I' | ||
Augie Fackler
|
r40530 | NODECOUNTSIZE = struct.calcsize(NODECOUNTSTRUCT) | ||
Augie Fackler
|
r43347 | PATHCOUNTSTRUCT = b'!I' | ||
Augie Fackler
|
r40530 | PATHCOUNTSIZE = struct.calcsize(PATHCOUNTSTRUCT) | ||
Augie Fackler
|
r43347 | FILEPACK_CATEGORY = b"" | ||
TREEPACK_CATEGORY = b"manifests" | ||||
Augie Fackler
|
r40530 | |||
ALL_CATEGORIES = [FILEPACK_CATEGORY, TREEPACK_CATEGORY] | ||||
# revision metadata keys. must be a single character. | ||||
Augie Fackler
|
r43347 | METAKEYFLAG = b'f' # revlog flag | ||
METAKEYSIZE = b's' # full rawtext size | ||||
Augie Fackler
|
r40530 | |||
Augie Fackler
|
r43346 | |||
Augie Fackler
|
r40530 | def getunits(category): | ||
if category == FILEPACK_CATEGORY: | ||||
Augie Fackler
|
r43347 | return _(b"files") | ||
Augie Fackler
|
r40530 | if category == TREEPACK_CATEGORY: | ||
Augie Fackler
|
r43347 | return _(b"trees") | ||
Augie Fackler
|
r40530 | |||
Augie Fackler
|
r43346 | |||
Augie Fackler
|
r40530 | # Repack options passed to ``markledger``. | ||
Augie Fackler
|
r43347 | OPTION_PACKSONLY = b'packsonly' | ||