comparison mercurial/shelve.py @ 49507:f0a3aaa07d6a stable

shelve: do not add the dirstate backup to the transaction Otherwise the transaction will properly clean up its mess on abort… deleting the backup in the process. This break with dirstate-v2 that has more file than just the dirstate. The dirstate itself is full of various exception and is "fine" when using dirstate-v1.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Tue, 04 Oct 2022 14:33:31 +0200
parents 2e726c934fcd
children a3356ab610fc
comparison
equal deleted inserted replaced
49505:b6c6ac6ef359 49507:f0a3aaa07d6a
376 376
377 377
378 def _aborttransaction(repo, tr): 378 def _aborttransaction(repo, tr):
379 """Abort current transaction for shelve/unshelve, but keep dirstate""" 379 """Abort current transaction for shelve/unshelve, but keep dirstate"""
380 dirstatebackupname = b'dirstate.shelve' 380 dirstatebackupname = b'dirstate.shelve'
381 repo.dirstate.savebackup(tr, dirstatebackupname) 381 repo.dirstate.savebackup(None, dirstatebackupname)
382 tr.abort() 382 tr.abort()
383 repo.dirstate.restorebackup(None, dirstatebackupname) 383 repo.dirstate.restorebackup(None, dirstatebackupname)
384 384
385 385
386 def getshelvename(repo, parent, opts): 386 def getshelvename(repo, parent, opts):