I've been playing with Mercurial's hooks lately. After I updated to the latest version (0.9.5) and toying a bit more with the hooks, I got this error after a hg push:
ValueError: invalid literal for int() with base 10: '1 files updated, 0 files merged, 0 files removed, 0 files unresolvedn'
The cause was my hook, which produced output that Mercurial didn't expect. The solution was to redirect the output to a log file. My hook config went from:
[hooks]
changegroup = hg update && ./localize && ./restart
to:
[hooks]
changegroup = (hg update && ./localize && ./restart) > push.log
This is the hook that's used on my webserver. All I need to do is a hg push command on my development machine, and my latest changes are pushed to my webserver, which in turn updates the website files and restarts the server to load in the new script.

Comments