almost rewrite chcvsroot function.