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