Should I do it like this?
https://github.com/projectkudu/kudu/blob/master/Kudu.Core/SourceControl/Hg/HgRepository.cs#L100