Revert "removed usage of OrderedDict in hg"

This reverts commit c3cd3c2edf66e6bc29516c59b2e209d68d6f6aa7.