purge extension doesn't need "#!/usr/bin/env python".
(from the Debian package: deb_specific__hgpurge.py.patch)
#!/bin/shhg init acd ahg init becho x > b/xecho '# should print nothing'hg stecho '# should print ? b/x'hg st b/xhg add b/xecho '# should print A b/x'hg stecho '# should forget b/x'hg revert --allecho '# should print nothing'hg st b