Fork of hg repository, original author is @andredias