mirror of
https://github.com/facebook/sapling.git
synced 2024-10-06 06:47:41 +03:00
store: always enable store and fncache
Summary: fncache and store have been default on for years. Enable them unconditionally. This also makes sure that metalog is always available. Practically, the only place that does not use fncache is hgsql server repos and they are irrelevant now. Reviewed By: DurhamG Differential Revision: D28595289 fbshipit-source-id: 32b9906c179518acdb17a206b54f98a3dc994921
This commit is contained in:
parent
65062e63e7
commit
1f8d8cfbf0
@ -320,12 +320,10 @@ coreconfigitem(
|
||||
)
|
||||
coreconfigitem("format", "chunkcachesize", default=None)
|
||||
coreconfigitem("format", "dirstate", default=2)
|
||||
coreconfigitem("format", "dotencode", default=True)
|
||||
coreconfigitem("format", "generaldelta", default=False)
|
||||
coreconfigitem("format", "manifestcachesize", default=None)
|
||||
coreconfigitem("format", "maxchainlen", default=None)
|
||||
coreconfigitem("format", "obsstore-version", default=None)
|
||||
coreconfigitem("format", "usefncache", default=True)
|
||||
coreconfigitem("format", "usegeneraldelta", default=True)
|
||||
coreconfigitem("format", "use-segmented-changelog", default=False)
|
||||
coreconfigitem("fsmonitor", "warn_when_unused", default=True)
|
||||
|
@ -1067,26 +1067,6 @@ Example for ``~/.hgrc``::
|
||||
|
||||
Enabled by default.
|
||||
|
||||
``dotencode``
|
||||
Enable or disable the "dotencode" repository format which enhances
|
||||
the "fncache" repository format (which has to be enabled to use
|
||||
dotencode) to avoid issues with filenames starting with ._ on
|
||||
Mac OS X and spaces on Windows.
|
||||
|
||||
Repositories with this on-disk format require Mercurial version 1.7.
|
||||
|
||||
Enabled by default.
|
||||
|
||||
``usefncache``
|
||||
Enable or disable the "fncache" repository format which enhances
|
||||
the "store" repository format (which has to be enabled to use
|
||||
fncache) to allow longer filenames and avoids using Windows
|
||||
reserved names, e.g. "nul".
|
||||
|
||||
Repositories with this on-disk format require Mercurial version 1.1.
|
||||
|
||||
Enabled by default.
|
||||
|
||||
``dirstate``
|
||||
Dirstate format version to use. One of 0 (flat dirstate), 1
|
||||
(treedirstate), and 2 (treestate). Default is 1.
|
||||
|
@ -3002,10 +3002,8 @@ def newreporequirements(repo):
|
||||
ui = repo.ui
|
||||
requirements = {"revlogv1"}
|
||||
requirements.add("store")
|
||||
if ui.configbool("format", "usefncache"):
|
||||
requirements.add("fncache")
|
||||
if ui.configbool("format", "dotencode"):
|
||||
requirements.add("dotencode")
|
||||
requirements.add("fncache")
|
||||
requirements.add("dotencode")
|
||||
|
||||
compengine = ui.config("experimental", "format.compression")
|
||||
if compengine not in util.compengines:
|
||||
|
@ -508,33 +508,6 @@ class basicstore(object):
|
||||
return self.vfs.exists(path)
|
||||
|
||||
|
||||
class encodedstore(basicstore):
|
||||
def __init__(self, path, vfstype):
|
||||
vfs = vfstype(path + "/store")
|
||||
self.path = vfs.base
|
||||
self.createmode = _calcmode(vfs)
|
||||
vfs.createmode = self.createmode
|
||||
self.rawvfs = vfs
|
||||
self.vfs = vfsmod.filtervfs(vfs, encodefilename)
|
||||
self.opener = self.vfs
|
||||
|
||||
def datafiles(self):
|
||||
for a, b, size in super(encodedstore, self).datafiles():
|
||||
try:
|
||||
a = decodefilename(a)
|
||||
except KeyError:
|
||||
a = None
|
||||
yield a, b, size
|
||||
|
||||
def join(self, f):
|
||||
return self.path + "/" + encodefilename(f)
|
||||
|
||||
def copylist(self):
|
||||
return ["requires", "00changelog.i", "store/requires"] + [
|
||||
"store/" + f for f in _data.split()
|
||||
]
|
||||
|
||||
|
||||
class fncache(object):
|
||||
# the filename used to be partially encoded
|
||||
# hence the encodedir/decodedir dance
|
||||
@ -808,19 +781,14 @@ class fncachestore(basicstore):
|
||||
|
||||
|
||||
def store(requirements, path, vfstype, uiconfig=None):
|
||||
if "store" in requirements:
|
||||
if "fncache" in requirements:
|
||||
store = fncachestore(path, vfstype, "dotencode" in requirements)
|
||||
if uiconfig and uiconfig.configbool("experimental", "metalog"):
|
||||
# Change remotenames and visibleheads to be backed by metalog,
|
||||
# so they can be atomically read or written.
|
||||
store.vfs.metapaths = {
|
||||
"remotenames",
|
||||
"visibleheads",
|
||||
"bookmarks",
|
||||
"config",
|
||||
"tip",
|
||||
}
|
||||
return store
|
||||
return encodedstore(path, vfstype)
|
||||
return basicstore(path, vfstype)
|
||||
store = fncachestore(path, vfstype, "dotencode" in requirements)
|
||||
# Change remotenames and visibleheads to be backed by metalog,
|
||||
# so they can be atomically read or written.
|
||||
store.vfs.metapaths = {
|
||||
"remotenames",
|
||||
"visibleheads",
|
||||
"bookmarks",
|
||||
"config",
|
||||
"tip",
|
||||
}
|
||||
return store
|
||||
|
@ -19,9 +19,3 @@ With metalog it works fine:
|
||||
|
||||
$ hg log -r A -T '{desc}\n' --config hooks.pre-bookmark-load='hg commit -m A3'
|
||||
A2
|
||||
|
||||
Without metalog:
|
||||
|
||||
$ setconfig experimental.metalog=false
|
||||
$ hg log -r A -T '{desc}\n' --config hooks.pre-bookmark-load='hg commit -m A4'
|
||||
A4
|
||||
|
@ -1265,10 +1265,6 @@ Separate sections from subsections
|
||||
|
||||
"usegeneraldelta"
|
||||
|
||||
"dotencode"
|
||||
|
||||
"usefncache"
|
||||
|
||||
"dirstate"
|
||||
|
||||
"uselz4"
|
||||
|
@ -66,6 +66,8 @@ creating repo with format.usefncache=false
|
||||
$ checknewrepo old2
|
||||
store created
|
||||
00changelog.i created
|
||||
dotencode
|
||||
fncache
|
||||
generaldelta
|
||||
lz4revlog
|
||||
revlogv1
|
||||
@ -78,6 +80,7 @@ creating repo with format.dotencode=false
|
||||
$ checknewrepo old3
|
||||
store created
|
||||
00changelog.i created
|
||||
dotencode
|
||||
fncache
|
||||
generaldelta
|
||||
lz4revlog
|
||||
|
Loading…
Reference in New Issue
Block a user