mirror of
https://github.com/facebook/sapling.git
synced 2024-10-10 08:47:12 +03:00
67a6bf19bd
Summary: It can sometimes be nice to be able to just repack loose data and avoid existing packs. This came up during building the megarepo, which creates many loose files, but including the packs added too much repack time. Differential Revision: D7209296 fbshipit-source-id: 10afed40e409733e0ee004f025013cf86f3f7bf6
38 lines
870 B
Python
38 lines
870 B
Python
from __future__ import absolute_import
|
|
from mercurial.i18n import _
|
|
|
|
import struct
|
|
|
|
REQUIREMENT = "remotefilelog"
|
|
|
|
FILENAMESTRUCT = '!H'
|
|
FILENAMESIZE = struct.calcsize(FILENAMESTRUCT)
|
|
|
|
NODESIZE = 20
|
|
PACKREQUESTCOUNTSTRUCT = '!I'
|
|
|
|
NODECOUNTSTRUCT = '!I'
|
|
NODECOUNTSIZE = struct.calcsize(NODECOUNTSTRUCT)
|
|
|
|
PATHCOUNTSTRUCT = '!I'
|
|
PATHCOUNTSIZE = struct.calcsize(PATHCOUNTSTRUCT)
|
|
|
|
FILEPACK_CATEGORY=""
|
|
TREEPACK_CATEGORY="manifests"
|
|
|
|
ALL_CATEGORIES = [FILEPACK_CATEGORY, TREEPACK_CATEGORY]
|
|
|
|
# revision metadata keys. must be a single character.
|
|
METAKEYFLAG = 'f' # revlog flag
|
|
METAKEYSIZE = 's' # full rawtext size
|
|
|
|
def getunits(category):
|
|
if category == FILEPACK_CATEGORY:
|
|
return _("files")
|
|
if category == TREEPACK_CATEGORY:
|
|
return _("trees")
|
|
|
|
# Repack options passed to ``markledger``.
|
|
OPTION_LOOSEONLY = 'looseonly'
|
|
OPTION_PACKSONLY = 'packsonly'
|