Initial copy from mercurial