Update hg.py to fix #547

support spaces in hg tag names
clean up code, add comment
correct docstring for hg parse_tags()
Merge pull request #548 from codedstructure/patch-1

Update hg.py to fix #547