##// END OF EJS Templates
localrepo: stop doing special dirstate backup at transaction open...
marmoute -
r50980:ff12f424 default
parent child Browse files
Show More
@@ -2548,8 +2548,6 b' class localrepository:'
2548 2548 # out) in this transaction
2549 2549 narrowspec.restorebackup(self, b'journal.narrowspec')
2550 2550 narrowspec.restorewcbackup(self, b'journal.narrowspec.dirstate')
2551 if repo.currentwlock() is not None:
2552 repo.dirstate.restorebackup(None, b'journal.dirstate')
2553 2551
2554 2552 repo.invalidate(clearfilecache=True)
2555 2553
@@ -2676,31 +2674,21 b' class localrepository:'
2676 2674 return tr
2677 2675
2678 2676 def _journalfiles(self):
2679 first = (
2677 return (
2680 2678 (self.svfs, b'journal'),
2681 2679 (self.svfs, b'journal.narrowspec'),
2682 2680 (self.vfs, b'journal.narrowspec.dirstate'),
2683 (self.vfs, b'journal.dirstate'),
2684 )
2685 middle = []
2686 dirstate_data = self.dirstate.data_backup_filename(b'journal.dirstate')
2687 if dirstate_data is not None:
2688 middle.append((self.vfs, dirstate_data))
2689 end = (
2690 2681 (self.vfs, b'journal.branch'),
2691 2682 (self.vfs, b'journal.desc'),
2692 2683 (bookmarks.bookmarksvfs(self), b'journal.bookmarks'),
2693 2684 (self.svfs, b'journal.phaseroots'),
2694 2685 )
2695 return first + tuple(middle) + end
2696 2686
2697 2687 def undofiles(self):
2698 2688 return [(vfs, undoname(x)) for vfs, x in self._journalfiles()]
2699 2689
2700 2690 @unfilteredmethod
2701 2691 def _writejournal(self, desc):
2702 if self.currentwlock() is not None:
2703 self.dirstate.savebackup(None, b'journal.dirstate')
2704 2692 narrowspec.savewcbackup(self, b'journal.narrowspec.dirstate')
2705 2693 narrowspec.savebackup(self, b'journal.narrowspec')
2706 2694 self.vfs.write(
@@ -2808,11 +2796,20 b' class localrepository:'
2808 2796 if self.svfs.exists(b'undo.phaseroots'):
2809 2797 self.svfs.rename(b'undo.phaseroots', b'phaseroots', checkambig=True)
2810 2798 self.invalidate()
2799 self.dirstate.invalidate()
2811 2800
2812 2801 if parentgone:
2802 # replace this with some explicit parent update in the future.
2803 has_node = self.changelog.index.has_node
2804 if not all(has_node(p) for p in self.dirstate._pl):
2805 # There was no dirstate to backup initially, we need to drop
2806 # the existing one.
2807 with self.dirstate.changing_parents(self):
2808 self.dirstate.setparents(self.nullid)
2809 self.dirstate.clear()
2810
2813 2811 narrowspec.restorebackup(self, b'undo.narrowspec')
2814 2812 narrowspec.restorewcbackup(self, b'undo.narrowspec.dirstate')
2815 self.dirstate.restorebackup(None, b'undo.dirstate')
2816 2813 try:
2817 2814 branch = self.vfs.read(b'undo.branch')
2818 2815 self.dirstate.setbranch(encoding.tolocal(branch))
@@ -261,11 +261,10 b' r4 has hardlinks in the working dir (not'
261 261 2 r4/.hg/store/undo.backup.phaseroots
262 262 2 r4/.hg/store/undo.backupfiles
263 263 2 r4/.hg/store/undo.phaseroots
264 [24] r4/\.hg/undo\.backup\.dirstate (re)
264 2 r4/\.hg/undo\.backup\.dirstate (re)
265 265 2 r4/.hg/undo.bookmarks
266 266 2 r4/.hg/undo.branch
267 267 2 r4/.hg/undo.desc
268 [24] r4/\.hg/undo\.dirstate (re)
269 268 2 r4/.hg/wcache/checkisexec (execbit !)
270 269 2 r4/.hg/wcache/checklink-target (symlink !)
271 270 2 r4/.hg/wcache/checknoexec (execbit !)
@@ -279,7 +278,7 b' Update back to revision 12 in r4 should '
279 278 #if hardlink-whitelisted
280 279 $ nlinksdir r4/.hg/undo.backup.dirstate r4/.hg/dirstate
281 280 2 r4/.hg/dirstate
282 4 r4/.hg/undo.backup.dirstate
281 2 r4/.hg/undo.backup.dirstate
283 282 #endif
284 283
285 284
@@ -319,11 +318,10 b' Update back to revision 12 in r4 should '
319 318 2 r4/.hg/store/undo.backup.phaseroots
320 319 2 r4/.hg/store/undo.backupfiles
321 320 2 r4/.hg/store/undo.phaseroots
322 [24] r4/\.hg/undo\.backup\.dirstate (re)
321 2 r4/\.hg/undo\.backup\.dirstate (re)
323 322 2 r4/.hg/undo.bookmarks
324 323 2 r4/.hg/undo.branch
325 324 2 r4/.hg/undo.desc
326 [24] r4/\.hg/undo\.dirstate (re)
327 325 2 r4/.hg/wcache/checkisexec (execbit !)
328 326 2 r4/.hg/wcache/checklink-target (symlink !)
329 327 2 r4/.hg/wcache/checknoexec (execbit !)
@@ -337,7 +335,7 b' Update back to revision 12 in r4 should '
337 335 #if hardlink-whitelisted
338 336 $ nlinksdir r4/.hg/undo.backup.dirstate r4/.hg/dirstate
339 337 1 r4/.hg/dirstate
340 4 r4/.hg/undo.backup.dirstate
338 2 r4/.hg/undo.backup.dirstate
341 339 #endif
342 340
343 341 Test hardlinking outside hg:
@@ -393,7 +393,6 b' New operations are blocked with the corr'
393 393 .hg/merge/state
394 394 .hg/rebasestate
395 395 .hg/undo.backup.dirstate
396 .hg/undo.dirstate
397 396 .hg/updatestate
398 397
399 398 $ hg rebase -s 3 -d tip
General Comments 0
You need to be logged in to leave comments. Login now