Mercurial > hg-stable
changeset 50285:473103758373 stable
undo-files: drop the old undo rename logic
It is no longer necessary
I am not changing the transaction.__init__ signature since we are on stable
right now.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Mon, 06 Mar 2023 19:39:35 +0100 |
parents | a43f0562220c |
children | 3d0b5760851c |
files | mercurial/localrepo.py |
diffstat | 1 files changed, 1 insertions(+), 20 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/localrepo.py Mon Mar 06 19:22:34 2023 +0100 +++ b/mercurial/localrepo.py Mon Mar 06 19:39:35 2023 +0100 @@ -2418,7 +2418,6 @@ self.hook(b'pretxnopen', throw=True, txnname=desc, txnid=txnid) self._writejournal(desc) - renames = [(vfs, x, undoname(x)) for vfs, x in self._journalfiles()] if report: rp = report else: @@ -2576,7 +2575,7 @@ vfsmap, b"journal", b"undo", - aftertrans(renames), + lambda: None, self.store.createmode, validator=validate, releasefn=releasefn, @@ -3549,24 +3548,6 @@ self._sidedata_computers[kind][category] = (keys, computer, flags) -# used to avoid circular references so destructors work -def aftertrans(files): - renamefiles = [tuple(t) for t in files] - - def a(): - for vfs, src, dest in renamefiles: - # if src and dest refer to a same file, vfs.rename is a no-op, - # leaving both src and dest on disk. delete dest to make sure - # the rename couldn't be such a no-op. - vfs.tryunlink(dest) - try: - vfs.rename(src, dest) - except FileNotFoundError: # journal file does not yet exist - pass - - return a - - def undoname(fn: bytes) -> bytes: base, name = os.path.split(fn) assert name.startswith(b'journal')