--- a/tests/test-command-template.t Sun Apr 29 14:29:09 2018 -0700
+++ b/tests/test-command-template.t Mon May 07 09:15:29 2018 -0700
@@ -3916,6 +3916,15 @@
$ hg log --template '{shortest("not a hex string, but it'\''s 40 bytes long")}\n' -l1
not a hex string, but it's 40 bytes long
+ $ hg log --template '{shortest("ffffffffffffffffffffffffffffffffffffffff")}\n' -l1
+ ffff
+
+ $ hg log --template '{shortest("fffffff")}\n' -l1
+ ffff
+
+ $ hg log --template '{shortest("ff")}\n' -l1
+ ffff
+
$ cd ..
Test shortest(node) with the repo having short hash collision: