Mon, 25 May 2015 01:26:23 +0900 localrepo: pass hook argument txnid to pretxnopen hooks stable
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Mon, 25 May 2015 01:26:23 +0900] rev 25268
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.
Mon, 25 May 2015 01:26:19 +0900 transaction: separate calculating TXNID from creating transaction object stable
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Mon, 25 May 2015 01:26:19 +0900] rev 25267
transaction: separate calculating TXNID from creating transaction object Before this patch, transaction ID (TXNID) is calculated from `transaction` object itself by `id()`, but this prevents TXNID from being passed to `pretxnopen` hooks, which should be executed before starting transaction processing (also any preparations for it, like writing journal files out). As a preparation for passing TXNID to `pretxnopen` hooks, this patch separates calculation of TXNID from creation of `transaction` object. This patch uses "random" library for reasonable unique ID. "uuid" library can't be used, because it was introduced since Python 2.5 and isn't suitable for Mercurial 3.4.x stable line. `%f` formatting for `random.random()` is used with explicit precision number 40, because default precision for `%f` is 6. 40 should be long enough, even if 10**9 transactions are executed in a short time (a second or less). On the other hand, `time.time()` is used to ensures uniqueness of TXNID in a long time, for safety. BTW, platform not providing `/dev/urandom` or so may cause failure of `import random` itself with some Python versions (see Python issue15340 for detail http://bugs.python.org/issue15340). But this patch uses "random" without any workaround, because: - "random" is already used directly in some code paths, - such platforms are very rare (e.g. Tru64 and HPUX), and http://bugs.python.org/issue15340#msg170000 - updating Python runtime can avoid this issue
Sat, 23 May 2015 11:14:00 +0900 revbranchcache: return uncached branchinfo for nullrev (issue4683) stable
Yuya Nishihara <yuya@tcha.org> [Sat, 23 May 2015 11:14:00 +0900] rev 25266
revbranchcache: return uncached branchinfo for nullrev (issue4683) This fixes the crash caused by "branch(null)" revset. No cache should be necessary for nullrev because changelog.branchinfo(nullrev) does not involve IO operation. Note that the problem of "branch(wdir())" isn't addressed by this patch. "wdir()" will raise TypeError in many places because of None. This is the reason why "wdir()" is still experimental.
(0) -10000 -3000 -1000 -300 -100 -30 -10 -3 +3 +10 +30 +100 +300 +1000 +3000 +10000 tip