Mercurial > hg
comparison hgext/shelve.py @ 26524:61c295d9d402
shelve: restore unshelved dirstate explicitly after aborting transaction
Before this patch, "hg unshelve" uses aborting a current transaction
to discard temporary changes while unshelving.
This assumes that dirstate changes in a transaction scope are kept
even after aborting it. But this assumption will be broken by
"transactional dirstate". See the wiki page below for detail about it.
https://mercurial.selenic.com/wiki/DirstateTransactionPlan
This patch explicitly saves shelved dirstate just before aborting
current transaction, and restore dirstate with it after aborting by
utility function '_aborttransaction()' added by previous patch.
author | FUJIWARA Katsunori <foozy@lares.dti.ne.jp> |
---|---|
date | Thu, 08 Oct 2015 01:41:30 +0900 |
parents | 1d23bf6cd90a |
children | 8f2ff40fe9c9 |
comparison
equal
deleted
inserted
replaced
26523:1d23bf6cd90a | 26524:61c295d9d402 |
---|---|
732 # hooks still fire and try to operate on the missing commits. | 732 # hooks still fire and try to operate on the missing commits. |
733 # Clean up manually to prevent this. | 733 # Clean up manually to prevent this. |
734 repo.unfiltered().changelog.strip(oldtiprev, tr) | 734 repo.unfiltered().changelog.strip(oldtiprev, tr) |
735 | 735 |
736 unshelvecleanup(ui, repo, basename, opts) | 736 unshelvecleanup(ui, repo, basename, opts) |
737 | |
738 _aborttransaction(repo) | |
737 finally: | 739 finally: |
738 ui.quiet = oldquiet | 740 ui.quiet = oldquiet |
739 if tr: | 741 if tr: |
740 tr.release() | 742 tr.release() |
741 lockmod.release(lock, wlock) | 743 lockmod.release(lock, wlock) |