reformat hg command inputs