added compat.py
fixed a UnicodeError under git usage
fixed a test for older mercurial version