Mercurial > public > mercurial-scm > hg
comparison mercurial/changelog.py @ 47241:2219853a1503
revlogv2: track pending write in the docket and expose it to hooks
The docket is now able to write pending data. We could have used a distinct
intermediate files, however keeping everything in the same file will make it
simpler to keep track of the various involved files if necessary.
However it might prove more complicated for streaming clone. This will be dealt
with later.
Note that we lifted the stderr redirection in the test since we no longer suffer
from "unkown working directory parent" message.
Differential Revision: https://phab.mercurial-scm.org/D10631
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Mon, 03 May 2021 12:35:25 +0200 |
parents | 4f38ada3fc26 |
children | 659a452ee263 |
comparison
equal
deleted
inserted
replaced
47240:4f38ada3fc26 | 47241:2219853a1503 |
---|---|
393 hooks processes) accessing data before a transaction is finalized. | 393 hooks processes) accessing data before a transaction is finalized. |
394 | 394 |
395 ``concurrencychecker`` will be passed to the revlog init function, see | 395 ``concurrencychecker`` will be passed to the revlog init function, see |
396 the documentation there. | 396 the documentation there. |
397 """ | 397 """ |
398 | |
399 revlog.revlog.__init__( | 398 revlog.revlog.__init__( |
400 self, | 399 self, |
401 opener, | 400 opener, |
402 target=(revlog_constants.KIND_CHANGELOG, None), | 401 target=(revlog_constants.KIND_CHANGELOG, None), |
403 radix=b'00changelog', | 402 radix=b'00changelog', |
482 self._enforceinlinesize(tr) | 481 self._enforceinlinesize(tr) |
483 | 482 |
484 def _writepending(self, tr): | 483 def _writepending(self, tr): |
485 """create a file containing the unfinalized state for | 484 """create a file containing the unfinalized state for |
486 pretxnchangegroup""" | 485 pretxnchangegroup""" |
486 if self._docket: | |
487 return self._docket.write(tr, pending=True) | |
487 if self._delaybuf: | 488 if self._delaybuf: |
488 # make a temporary copy of the index | 489 # make a temporary copy of the index |
489 fp1 = self._realopener(self._indexfile) | 490 fp1 = self._realopener(self._indexfile) |
490 pendingfilename = self._indexfile + b".a" | 491 pendingfilename = self._indexfile + b".a" |
491 # register as a temp file to ensure cleanup on failure | 492 # register as a temp file to ensure cleanup on failure |