[opensource-dev] Mercurial hook checking for well-formed XML

Oz Linden (Scott Lawrence) oz at lindenlab.com
Tue Aug 16 08:06:34 PDT 2011


In response to my earlier note on this list about my Mercurial hook to 
check for well-formed XML at commit time, CG kindly pointed me to the 
hooks written by Bos for a more extensive set of LL policy checks 
(including well-formed XML).

Needless to say, the version Bos wrote is more elegant than mine (but I 
probably learned more by doing the first version myself).  In addition 
to providing several other checks (correct line endings, tabs where they 
don't belong, file name safety, copyrights and licenses), it also 
provides a command line hg extension (hg policy) that can be used to do 
checks before a commit.

I have updated his script to work with current versions of Mercurial 
(there was one minor api change), and added a feature of two of my 
own.   I've gotten approval to push this out to the public bitbucket, 
and have documented it at:

   https://wiki.secondlife.com/wiki/Mercurial_Tools

I'll be using that version now, and encourage you to do the same.

Not everything in the viewer-development tree passes these checks yet, 
but that won't bite you unless you modify something that already fails 
(the hook only checks modified files that are present in the new tip).   
I'll either clean up the problems that have accumulated in 
viewer-development or modify the tests to allow them over the next week 
or two.




More information about the opensource-dev mailing list