Skip to content

Instantly share code, notes, and snippets.

@cointoss1973
Created May 7, 2012 10:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cointoss1973/2627033 to your computer and use it in GitHub Desktop.
Save cointoss1973/2627033 to your computer and use it in GitHub Desktop.
TEST batch file for hg heads on hook
REM hg heads on hook
hg version
hg init tmphook
REM ----- Setup hooks -----
cd tmphook
echo hg heads > .hg\heads.bat
echo [hooks] > .hg\hgrc
echo pretxnchangegroup.heads = .hg\heads.bat >> .hg\hgrc
REM ----- some commits -----
echo a > a
hg commit -Am "added a"
echo b > b
hg commit -Am "added b"
cd ..
REM ----- clone -----
hg clone tmphook tmphookc
cd tmphookc
hg up 0
echo 1 > 1
hg commit -Am "added 1"
REM hg heads
REM ----- push -f (multipul heads) -----
hg push -f
cd ..
@cointoss1973
Copy link
Author

Mercurial 2.2.1 on Windows 7 : NG
Mercurial 1.9.3 on Windows XP: OK

@cointoss1973
Copy link
Author

Mercurial 2.1.2 on Windows 7 is OK.
Mercurial 2.2.1 on Windows 7 is NG.

c:\Users\tkondou\hgrepo\tmphook>hg heads
abort: 00changelog.i@8b59e1e912ee: no node!
transaction abort!
rollback completed
abort: pretxnchangegroup.heads hook exited with status 255

c:\Users\tkondou\hgrepo\tmphookc>cd ..

tkondou@MATRIX ~/hgrepo
$ hg version
Mercurial Distributed SCM (version 2.2.1)
(see http://mercurial.selenic.com for more information)

Copyright (C) 2005-2012 Matt Mackall and others
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment