equal
deleted
inserted
replaced
39 (uid_size,) = S_HEADER.unpack(pdata[offset : offset + S_HEADER.size]) |
39 (uid_size,) = S_HEADER.unpack(pdata[offset : offset + S_HEADER.size]) |
40 offset += S_HEADER.size |
40 offset += S_HEADER.size |
41 docket = NodeMapDocket(pdata[offset : offset + uid_size]) |
41 docket = NodeMapDocket(pdata[offset : offset + uid_size]) |
42 |
42 |
43 filename = _rawdata_filepath(revlog, docket) |
43 filename = _rawdata_filepath(revlog, docket) |
44 return revlog.opener.tryread(filename) |
44 return docket, revlog.opener.tryread(filename) |
45 |
45 |
46 |
46 |
47 def setup_persistent_nodemap(tr, revlog): |
47 def setup_persistent_nodemap(tr, revlog): |
48 """Install whatever is needed transaction side to persist a nodemap on disk |
48 """Install whatever is needed transaction side to persist a nodemap on disk |
49 |
49 |
91 fd.write(data) |
91 fd.write(data) |
92 # EXP-TODO: if this is a cache, this should use a cache vfs, not a |
92 # EXP-TODO: if this is a cache, this should use a cache vfs, not a |
93 # store vfs |
93 # store vfs |
94 with revlog.opener(revlog.nodemap_file, b'w', atomictemp=True) as fp: |
94 with revlog.opener(revlog.nodemap_file, b'w', atomictemp=True) as fp: |
95 fp.write(target_docket.serialize()) |
95 fp.write(target_docket.serialize()) |
|
96 revlog._nodemap_docket = target_docket |
96 # EXP-TODO: if the transaction abort, we should remove the new data and |
97 # EXP-TODO: if the transaction abort, we should remove the new data and |
97 # reinstall the old one. |
98 # reinstall the old one. |
98 |
99 |
99 |
100 |
100 ### Nodemap docket file |
101 ### Nodemap docket file |