Mercurial > public > mercurial-scm > hg-stable
diff mercurial/localrepo.py @ 24281:e9ede9b4c2f8
hook: have a generic hook for transaction opening
We are adding generic hooking for all transactions. We do not really have any
useful information to include when opening the transaction but this is a
useful time to allow a hook anyway. We better let people abort transaction before
they happen than after multiple seconds/minutes of processing.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Wed, 10 Dec 2014 18:19:49 -0800 |
parents | 7977d35df13b |
children | db8679812f84 |
line wrap: on
line diff
--- a/mercurial/localrepo.py Tue Feb 24 00:04:55 2015 +0900 +++ b/mercurial/localrepo.py Wed Dec 10 18:19:49 2014 -0800 @@ -909,6 +909,8 @@ _("abandoned transaction found"), hint=_("run 'hg recover' to clean up transaction")) + self.hook('pretxnopen', throw=True, txnname=desc) + self._writejournal(desc) renames = [(vfs, x, undoname(x)) for vfs, x in self._journalfiles()] rp = report and report or self.ui.warn