comparison mercurial/branching/rev_cache.py @ 51902:0f26ee69cf36

rev-branch-cache: increment the version to "v2" We want to ensure no older clients will truncate the file under us. So we need to change their name. We don't change the rest of the format (unfortunaly).
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Tue, 24 Sep 2024 03:16:35 +0200
parents c564be351754
children bd7359c18d69
comparison
equal deleted inserted replaced
51901:c564be351754 51902:0f26ee69cf36
26 unpack_from = struct.unpack_from 26 unpack_from = struct.unpack_from
27 27
28 28
29 # Revision branch info cache 29 # Revision branch info cache
30 30
31 _rbcversion = b'-v1' 31 # The "V2" version use the same format as the "V1" but garantee it won't be
32 # truncated, preventing SIGBUS when it is mmap-ed
33 _rbcversion = b'-v2'
32 _rbcnames = b'rbc-names' + _rbcversion 34 _rbcnames = b'rbc-names' + _rbcversion
33 _rbcrevs = b'rbc-revs' + _rbcversion 35 _rbcrevs = b'rbc-revs' + _rbcversion
34 # [4 byte hash prefix][4 byte branch name number with sign bit indicating open] 36 # [4 byte hash prefix][4 byte branch name number with sign bit indicating open]
35 _rbcrecfmt = b'>4sI' 37 _rbcrecfmt = b'>4sI'
36 _rbcrecsize = calcsize(_rbcrecfmt) 38 _rbcrecsize = calcsize(_rbcrecfmt)