I apparently moved this function from templater.py in 448725a2ef73
(templater: extract shortest() logic from template function,
2017-09-15). Now we have scmutil.resolvehexnodeidprefix(), so it makes
sense to have this method next to it.
Note that the change in show.py also makes it so the conversion from
revnum to nodeid is done on the filtered repo, but that should be
inconsequential since the revs are all from the filtered repo anyway.