Debian Codegraph @

hgext/remotefilelog/constants.py

raw
1 from __future__ import annotations
2
3 import struct
4
5 from mercurial.i18n import _
6
7 NETWORK_CAP_LEGACY_SSH_GETFILES = b'exp-remotefilelog-ssh-getfiles-1'
8
9 SHALLOWREPO_REQUIREMENT = b"exp-remotefilelog-repo-req-1"
10
11 BUNDLE2_CAPABLITY = b"exp-remotefilelog-b2cap-1"
12
13 FILENAMESTRUCT = b'!H'
14 FILENAMESIZE = struct.calcsize(FILENAMESTRUCT)
15
16 NODESIZE = 20
17 PACKREQUESTCOUNTSTRUCT = b'!I'
18
19 NODECOUNTSTRUCT = b'!I'
20 NODECOUNTSIZE = struct.calcsize(NODECOUNTSTRUCT)
21
22 PATHCOUNTSTRUCT = b'!I'
23 PATHCOUNTSIZE = struct.calcsize(PATHCOUNTSTRUCT)
24
25 FILEPACK_CATEGORY = b""
26 TREEPACK_CATEGORY = b"manifests"
27
28 ALL_CATEGORIES = [FILEPACK_CATEGORY, TREEPACK_CATEGORY]
29
30 # revision metadata keys. must be a single character.
31 METAKEYFLAG = b'f' # revlog flag
32 METAKEYSIZE = b's' # full rawtext size
33
34
35 def getunits(category):
36 if category == FILEPACK_CATEGORY:
37 return _(b"files")
38 if category == TREEPACK_CATEGORY:
39 return _(b"trees")
40
41
42 # Repack options passed to ``markledger``.
43 OPTION_PACKSONLY = b'packsonly'