這絕對應該是既tip
和log
反映到來後信息的情況。你肯定在你運行這些命令的目錄是庫triggehg克隆hooktest hooktest克隆 環鉤?我可以看到,不是這種情況的唯一方法是如果你使用hg -R
,你會知道。
這是一個測試腳本,你應該能夠粘貼到(UNIX或Cygwin的)外殼:
hg init hooktest
echo this >> hooktest/afile
echo -e '[hooks]\npretxnchangegroup = hg log && hg tip' >> hooktest/.hg/hgrc
hg -R hooktest commit -A -m 'initial commit'
hg clone hooktest hooktest-clone
echo more >> hooktest-clone/afile
hg -R hooktest-clone commit -m 'second commit'
hg -R hooktest-clone push
當我粘貼,我得到:
[email protected] [~/hg] % hg init hooktest
[email protected] [~/hg] % echo this >> hooktest/afile
[email protected] [~/hg] % echo -e '[hooks]\npretxnchangegroup = hg log && hg tip' >> hooktest/.hg/hgrc
[email protected] [~/hg] % hg -R hooktest commit -A -m 'initial commit'
adding afile
[email protected] [~/hg] % hg clone hooktest hooktest-clone
updating working directory
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
[email protected] [~/hg] % echo more >> hooktest-clone/afile
[email protected] [~/hg] % hg -R hooktest-clone commit -m 'second commit'
[email protected] [~/hg] % hg -R hooktest-clone push
pushing to /home/msi/ry4an/hg/hooktest
searching for changes
adding changesets
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files
changeset: 1:ab2cec57f878
tag: tip
user: Ry4an Brase <[email protected]>
date: Wed Nov 03 09:10:40 2010 -0500
summary: second commit
changeset: 0:30db2e527437
user: Ry4an Brase <[email protected]>
date: Wed Nov 03 09:10:39 2010 -0500
summary: initial commit
changeset: 1:ab2cec57f878
tag: tip
user: Ry4an Brase <[email protected]>
date: Wed Nov 03 09:10:40 2010 -0500
summary: second commit
[email protected] [~/hg] %
在這裏你可以看到,無論是'hg log'和'hg tip'顯示鉤子中的新變更集。
確實爲你試運行?
下面我想你的術語是有點過我會去一個答案。你試圖「看到整個變更組」,它由許多變更集組成。 $ HG_NODE指向一個變更集。 – 2010-11-03 13:54:07