first commit pulled in from kazuto's hg clone.