[Commented On] D10867: revlog: add docket method to request new content files
baymax (Baymax, Your Personal Patch-care Companion)
phabricator at mercurial-scm.org
Tue Jun 15 11:39:32 UTC 2021
baymax added a comment.
baymax updated this revision to Diff 28567.
✅ refresh by Heptapod after a successful CI run (🐙 💚)
REPOSITORY
rHG Mercurial
CHANGES SINCE LAST UPDATE
https://phab.mercurial-scm.org/D10867?vs=28550&id=28567
BRANCH
default
CHANGES SINCE LAST ACTION
https://phab.mercurial-scm.org/D10867/new/
REVISION DETAIL
https://phab.mercurial-scm.org/D10867
AFFECTED FILES
mercurial/revlogutils/docket.py
CHANGE DETAILS
diff --git a/mercurial/revlogutils/docket.py b/mercurial/revlogutils/docket.py
--- a/mercurial/revlogutils/docket.py
+++ b/mercurial/revlogutils/docket.py
@@ -171,6 +171,15 @@
self._index_uuid = make_uid()
return b"%s-%s.idx" % (self._radix, self._index_uuid)
+ def new_index_file(self):
+ """switch index file to a new UID
+
+ The previous index UID is moved to the "older" list."""
+ old = (self._index_uuid, self._index_end)
+ self._older_index_uuids.insert(0, old)
+ self._index_uuid = make_uid()
+ return self.index_filepath()
+
def data_filepath(self):
"""file path to the current data file associated to this docket"""
# very simplistic version at first
@@ -178,6 +187,15 @@
self._data_uuid = make_uid()
return b"%s-%s.dat" % (self._radix, self._data_uuid)
+ def new_data_file(self):
+ """switch data file to a new UID
+
+ The previous data UID is moved to the "older" list."""
+ old = (self._data_uuid, self._data_end)
+ self._older_data_uuids.insert(0, old)
+ self._data_uuid = make_uid()
+ return self.data_filepath()
+
def sidedata_filepath(self):
"""file path to the current sidedata file associated to this docket"""
# very simplistic version at first
@@ -185,6 +203,15 @@
self._sidedata_uuid = make_uid()
return b"%s-%s.sda" % (self._radix, self._sidedata_uuid)
+ def new_sidedata_file(self):
+ """switch sidedata file to a new UID
+
+ The previous sidedata UID is moved to the "older" list."""
+ old = (self._sidedata_uuid, self._sidedata_end)
+ self._older_sidedata_uuids.insert(0, old)
+ self._sidedata_uuid = make_uid()
+ return self.sidedata_filepath()
+
@property
def index_end(self):
return self._index_end
To: marmoute, #hg-reviewers
Cc: mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-patches/attachments/20210615/e4c28512/attachment-0002.html>
More information about the Mercurial-patches
mailing list