Mercurial > public > mercurial-scm > hg
diff mercurial/localrepo.py @ 25268:a973b050621d stable
localrepo: pass hook argument txnid to pretxnopen hooks
Before this patch, hook argument `txnid` isn't passed to `pretxnopen`
hooks, even though `hooks` section of `hg help config` describes so.
``pretxnopen``
Run before any new repository transaction is open. The reason for the
transaction will be in ``$HG_TXNNAME`` and a unique identifier for the
transaction will be in ``HG_TXNID``. A non-zero status will prevent the
transaction from being opened.
author | FUJIWARA Katsunori <foozy@lares.dti.ne.jp> |
---|---|
date | Mon, 25 May 2015 01:26:23 +0900 |
parents | 69c5cab0b893 |
children | 61b3529e2377 |
line wrap: on
line diff
--- a/mercurial/localrepo.py Mon May 25 01:26:19 2015 +0900 +++ b/mercurial/localrepo.py Mon May 25 01:26:23 2015 +0900 @@ -962,7 +962,7 @@ idbase = "%.40f#%f" % (random.random(), time.time()) txnid = 'TXN:' + util.sha1(idbase).hexdigest() - self.hook('pretxnopen', throw=True, txnname=desc) + self.hook('pretxnopen', throw=True, txnname=desc, txnid=txnid) self._writejournal(desc) renames = [(vfs, x, undoname(x)) for vfs, x in self._journalfiles()]