Mercurial > public > mercurial-scm > hg
comparison mercurial/localrepo.py @ 50194:8fb391363aad
transaction: no longer explicitly cache bookmarks
The transaction file generation is already dealing with the backup for this.
So, no need to duplicate such backup.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Thu, 23 Feb 2023 04:53:34 +0100 |
parents | ab806355fccb |
children | 11e6eee4b063 |
comparison
equal
deleted
inserted
replaced
50193:ab806355fccb | 50194:8fb391363aad |
---|---|
2685 def _journalfiles(self): | 2685 def _journalfiles(self): |
2686 return ( | 2686 return ( |
2687 (self.svfs, b'journal'), | 2687 (self.svfs, b'journal'), |
2688 (self.vfs, b'journal.branch'), | 2688 (self.vfs, b'journal.branch'), |
2689 (self.vfs, b'journal.desc'), | 2689 (self.vfs, b'journal.desc'), |
2690 (bookmarks.bookmarksvfs(self), b'journal.bookmarks'), | |
2691 ) | 2690 ) |
2692 | 2691 |
2693 def undofiles(self): | 2692 def undofiles(self): |
2694 return [(vfs, undoname(x)) for vfs, x in self._journalfiles()] | 2693 return [(vfs, undoname(x)) for vfs, x in self._journalfiles()] |
2695 | 2694 |
2697 def _writejournal(self, desc): | 2696 def _writejournal(self, desc): |
2698 self.vfs.write( | 2697 self.vfs.write( |
2699 b"journal.branch", encoding.fromlocal(self.dirstate.branch()) | 2698 b"journal.branch", encoding.fromlocal(self.dirstate.branch()) |
2700 ) | 2699 ) |
2701 self.vfs.write(b"journal.desc", b"%d\n%s\n" % (len(self), desc)) | 2700 self.vfs.write(b"journal.desc", b"%d\n%s\n" % (len(self), desc)) |
2702 bookmarksvfs = bookmarks.bookmarksvfs(self) | |
2703 bookmarksvfs.write( | |
2704 b"journal.bookmarks", bookmarksvfs.tryread(b"bookmarks") | |
2705 ) | |
2706 | 2701 |
2707 def recover(self): | 2702 def recover(self): |
2708 with self.lock(): | 2703 with self.lock(): |
2709 if self.svfs.exists(b"journal"): | 2704 if self.svfs.exists(b"journal"): |
2710 self.ui.status(_(b"rolling back interrupted transaction\n")) | 2705 self.ui.status(_(b"rolling back interrupted transaction\n")) |
2789 b'undo', | 2784 b'undo', |
2790 ui.warn, | 2785 ui.warn, |
2791 checkambigfiles=_cachedfiles, | 2786 checkambigfiles=_cachedfiles, |
2792 skip_journal_pattern=skip_journal_pattern, | 2787 skip_journal_pattern=skip_journal_pattern, |
2793 ) | 2788 ) |
2794 bookmarksvfs = bookmarks.bookmarksvfs(self) | |
2795 if bookmarksvfs.exists(b'undo.bookmarks'): | |
2796 bookmarksvfs.rename( | |
2797 b'undo.bookmarks', b'bookmarks', checkambig=True | |
2798 ) | |
2799 self.invalidate() | 2789 self.invalidate() |
2800 self.dirstate.invalidate() | 2790 self.dirstate.invalidate() |
2801 | 2791 |
2802 if parentgone: | 2792 if parentgone: |
2803 # replace this with some explicit parent update in the future. | 2793 # replace this with some explicit parent update in the future. |