##// END OF EJS Templates
rust-dirstate-v2: don't write dirstate if data file has changed...
rust-dirstate-v2: don't write dirstate if data file has changed This fixes the following race: - process A reads the dirstate - process B reads and writes the dirstate - process A writes the dirstate This either resulted in losing what process B had just written or a crash because the `uuid` had changed and we were trying to write to a file that doesn't exist. More explanations inside. This doesn't fix the issue for dirstate-v1, a later patch addresses it.

File last commit:

r49730:6000f5b2 default
r51139:07d030b3 stable
Show More
constants.py
41 lines | 966 B | text/x-python | PythonLexer
import struct
from mercurial.i18n import _
NETWORK_CAP_LEGACY_SSH_GETFILES = b'exp-remotefilelog-ssh-getfiles-1'
SHALLOWREPO_REQUIREMENT = b"exp-remotefilelog-repo-req-1"
BUNDLE2_CAPABLITY = b"exp-remotefilelog-b2cap-1"
FILENAMESTRUCT = b'!H'
FILENAMESIZE = struct.calcsize(FILENAMESTRUCT)
NODESIZE = 20
PACKREQUESTCOUNTSTRUCT = b'!I'
NODECOUNTSTRUCT = b'!I'
NODECOUNTSIZE = struct.calcsize(NODECOUNTSTRUCT)
PATHCOUNTSTRUCT = b'!I'
PATHCOUNTSIZE = struct.calcsize(PATHCOUNTSTRUCT)
FILEPACK_CATEGORY = b""
TREEPACK_CATEGORY = b"manifests"
ALL_CATEGORIES = [FILEPACK_CATEGORY, TREEPACK_CATEGORY]
# revision metadata keys. must be a single character.
METAKEYFLAG = b'f' # revlog flag
METAKEYSIZE = b's' # full rawtext size
def getunits(category):
if category == FILEPACK_CATEGORY:
return _(b"files")
if category == TREEPACK_CATEGORY:
return _(b"trees")
# Repack options passed to ``markledger``.
OPTION_PACKSONLY = b'packsonly'