##// END OF EJS Templates
localrepo: pass hook argument txnid to pretxnopen hooks...
FUJIWARA Katsunori -
r25268:a973b050 stable
parent child Browse files
Show More
@@ -962,7 +962,7 b' class localrepository(object):'
962
962
963 idbase = "%.40f#%f" % (random.random(), time.time())
963 idbase = "%.40f#%f" % (random.random(), time.time())
964 txnid = 'TXN:' + util.sha1(idbase).hexdigest()
964 txnid = 'TXN:' + util.sha1(idbase).hexdigest()
965 self.hook('pretxnopen', throw=True, txnname=desc)
965 self.hook('pretxnopen', throw=True, txnname=desc, txnid=txnid)
966
966
967 self._writejournal(desc)
967 self._writejournal(desc)
968 renames = [(vfs, x, undoname(x)) for vfs, x in self._journalfiles()]
968 renames = [(vfs, x, undoname(x)) for vfs, x in self._journalfiles()]
@@ -29,7 +29,7 b' commit hooks can see env vars'
29 $ hg add a
29 $ hg add a
30 $ hg commit -m a
30 $ hg commit -m a
31 precommit hook: HG_PARENT1=0000000000000000000000000000000000000000
31 precommit hook: HG_PARENT1=0000000000000000000000000000000000000000
32 pretxnopen hook: HG_TXNNAME=commit
32 pretxnopen hook: HG_TXNID=TXN:* HG_TXNNAME=commit (glob)
33 pretxncommit hook: HG_NODE=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b HG_PARENT1=0000000000000000000000000000000000000000 HG_PENDING=$TESTTMP/a
33 pretxncommit hook: HG_NODE=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b HG_PARENT1=0000000000000000000000000000000000000000 HG_PENDING=$TESTTMP/a
34 0:cb9a9f314b8b
34 0:cb9a9f314b8b
35 pretxnclose hook: HG_PENDING=$TESTTMP/a HG_PHASES_MOVED=1 HG_TXNID=TXN:* HG_TXNNAME=commit (glob)
35 pretxnclose hook: HG_PENDING=$TESTTMP/a HG_PHASES_MOVED=1 HG_TXNID=TXN:* HG_TXNNAME=commit (glob)
@@ -57,7 +57,7 b' pretxncommit and commit hooks can see bo'
57 $ echo b >> a
57 $ echo b >> a
58 $ hg commit -m a1 -d "1 0"
58 $ hg commit -m a1 -d "1 0"
59 precommit hook: HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b
59 precommit hook: HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b
60 pretxnopen hook: HG_TXNNAME=commit
60 pretxnopen hook: HG_TXNID=TXN:* HG_TXNNAME=commit (glob)
61 pretxncommit hook: HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b HG_PENDING=$TESTTMP/a
61 pretxncommit hook: HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b HG_PENDING=$TESTTMP/a
62 1:ab228980c14d
62 1:ab228980c14d
63 pretxnclose hook: HG_PENDING=$TESTTMP/a HG_TXNID=TXN:* HG_TXNNAME=commit (glob)
63 pretxnclose hook: HG_PENDING=$TESTTMP/a HG_TXNID=TXN:* HG_TXNNAME=commit (glob)
@@ -70,7 +70,7 b' pretxncommit and commit hooks can see bo'
70 $ hg add b
70 $ hg add b
71 $ hg commit -m b -d '1 0'
71 $ hg commit -m b -d '1 0'
72 precommit hook: HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b
72 precommit hook: HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b
73 pretxnopen hook: HG_TXNNAME=commit
73 pretxnopen hook: HG_TXNID=TXN:* HG_TXNNAME=commit (glob)
74 pretxncommit hook: HG_NODE=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b HG_PENDING=$TESTTMP/a
74 pretxncommit hook: HG_NODE=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b HG_PENDING=$TESTTMP/a
75 2:ee9deb46ab31
75 2:ee9deb46ab31
76 pretxnclose hook: HG_PENDING=$TESTTMP/a HG_TXNID=TXN:* HG_TXNNAME=commit (glob)
76 pretxnclose hook: HG_PENDING=$TESTTMP/a HG_TXNID=TXN:* HG_TXNNAME=commit (glob)
@@ -83,7 +83,7 b' pretxncommit and commit hooks can see bo'
83 (branch merge, don't forget to commit)
83 (branch merge, don't forget to commit)
84 $ hg commit -m merge -d '2 0'
84 $ hg commit -m merge -d '2 0'
85 precommit hook: HG_PARENT1=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT2=ab228980c14deea8b9555d91c9581127383e40fd
85 precommit hook: HG_PARENT1=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT2=ab228980c14deea8b9555d91c9581127383e40fd
86 pretxnopen hook: HG_TXNNAME=commit
86 pretxnopen hook: HG_TXNID=TXN:* HG_TXNNAME=commit (glob)
87 pretxncommit hook: HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2 HG_PARENT1=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT2=ab228980c14deea8b9555d91c9581127383e40fd HG_PENDING=$TESTTMP/a
87 pretxncommit hook: HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2 HG_PARENT1=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT2=ab228980c14deea8b9555d91c9581127383e40fd HG_PENDING=$TESTTMP/a
88 3:07f3376c1e65
88 3:07f3376c1e65
89 pretxnclose hook: HG_PENDING=$TESTTMP/a HG_TXNID=TXN:* HG_TXNNAME=commit (glob)
89 pretxnclose hook: HG_PENDING=$TESTTMP/a HG_TXNID=TXN:* HG_TXNNAME=commit (glob)
@@ -127,7 +127,7 b' tag hooks can see env vars'
127 $ hg tag -d '3 0' a
127 $ hg tag -d '3 0' a
128 pretag hook: HG_LOCAL=0 HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2 HG_TAG=a
128 pretag hook: HG_LOCAL=0 HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2 HG_TAG=a
129 precommit hook: HG_PARENT1=07f3376c1e655977439df2a814e3cc14b27abac2
129 precommit hook: HG_PARENT1=07f3376c1e655977439df2a814e3cc14b27abac2
130 pretxnopen hook: HG_TXNNAME=commit
130 pretxnopen hook: HG_TXNID=TXN:* HG_TXNNAME=commit (glob)
131 pretxncommit hook: HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_PARENT1=07f3376c1e655977439df2a814e3cc14b27abac2 HG_PENDING=$TESTTMP/a
131 pretxncommit hook: HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_PARENT1=07f3376c1e655977439df2a814e3cc14b27abac2 HG_PENDING=$TESTTMP/a
132 4:539e4b31b6dc
132 4:539e4b31b6dc
133 pretxnclose hook: HG_PENDING=$TESTTMP/a HG_TXNID=TXN:* HG_TXNNAME=commit (glob)
133 pretxnclose hook: HG_PENDING=$TESTTMP/a HG_TXNID=TXN:* HG_TXNNAME=commit (glob)
@@ -164,7 +164,7 b' more there after'
164 4:539e4b31b6dc
164 4:539e4b31b6dc
165 $ hg commit -m 'fail' -d '4 0'
165 $ hg commit -m 'fail' -d '4 0'
166 precommit hook: HG_PARENT1=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10
166 precommit hook: HG_PARENT1=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10
167 pretxnopen hook: HG_TXNNAME=commit
167 pretxnopen hook: HG_TXNID=TXN:* HG_TXNNAME=commit (glob)
168 pretxncommit hook: HG_NODE=6f611f8018c10e827fee6bd2bc807f937e761567 HG_PARENT1=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_PENDING=$TESTTMP/a
168 pretxncommit hook: HG_NODE=6f611f8018c10e827fee6bd2bc807f937e761567 HG_PARENT1=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_PENDING=$TESTTMP/a
169 5:6f611f8018c1
169 5:6f611f8018c1
170 5:6f611f8018c1
170 5:6f611f8018c1
@@ -228,7 +228,7 b' pushkey hook'
228 pushing to ../a
228 pushing to ../a
229 searching for changes
229 searching for changes
230 no changes found
230 no changes found
231 pretxnopen hook: HG_TXNNAME=bookmarks
231 pretxnopen hook: HG_TXNID=TXN:* HG_TXNNAME=bookmarks (glob)
232 pretxnclose hook: HG_BOOKMARK_MOVED=1 HG_PENDING=$TESTTMP/a HG_TXNID=TXN:* HG_TXNNAME=bookmarks (glob)
232 pretxnclose hook: HG_BOOKMARK_MOVED=1 HG_PENDING=$TESTTMP/a HG_TXNID=TXN:* HG_TXNNAME=bookmarks (glob)
233 txnclose hook: HG_BOOKMARK_MOVED=1 HG_TXNID=TXN:* HG_TXNNAME=bookmarks (glob)
233 txnclose hook: HG_BOOKMARK_MOVED=1 HG_TXNID=TXN:* HG_TXNNAME=bookmarks (glob)
234 pushkey hook: HG_KEY=foo HG_NAMESPACE=bookmarks HG_NEW=0000000000000000000000000000000000000000 HG_RET=1
234 pushkey hook: HG_KEY=foo HG_NAMESPACE=bookmarks HG_NEW=0000000000000000000000000000000000000000 HG_RET=1
General Comments 0
You need to be logged in to leave comments. Login now