Update the py library, as it comes pre installed as an older version in Travis.

See http://docs.travis-ci.com/user/ci-environment/#Python-VM-images
added compat.py
fixed a test for older mercurial version
Fixed submodule matching for some git versions.
Merge branch 'pr-143'