Escape directory separators in path to root (hg)