##// END OF EJS Templates
shortest: use 'x' prefix to disambiguate from revnum if configured...
Martin von Zweigbergk -
r38892:a01200b2 default
parent child Browse files
Show More
@@ -490,6 +490,12 b' def shortesthexnodeidprefix(repo, node, '
490
490
491 def disambiguate(prefix):
491 def disambiguate(prefix):
492 """Disambiguate against revnums."""
492 """Disambiguate against revnums."""
493 if repo.ui.configbool('experimental', 'revisions.prefixhexnode'):
494 if mayberevnum(repo, prefix):
495 return 'x' + prefix
496 else:
497 return prefix
498
493 hexnode = hex(node)
499 hexnode = hex(node)
494 for length in range(len(prefix), len(hexnode) + 1):
500 for length in range(len(prefix), len(hexnode) + 1):
495 prefix = hexnode[:length]
501 prefix = hexnode[:length]
@@ -892,6 +892,11 b' Test shortest(node) with the repo having'
892 $ hg log -r 4 -T '{rev}:{shortest(node, 0)}\n' --hidden
892 $ hg log -r 4 -T '{rev}:{shortest(node, 0)}\n' --hidden
893 4:107
893 4:107
894
894
895 $ hg --config experimental.revisions.prefixhexnode=yes log -r 4 -T '{rev}:{shortest(node, 0)}\n'
896 4:x10
897 $ hg --config experimental.revisions.prefixhexnode=yes log -r 4 -T '{rev}:{shortest(node, 0)}\n' --hidden
898 4:x10
899
895 node 'c562' should be unique if the other 'c562' nodes are hidden
900 node 'c562' should be unique if the other 'c562' nodes are hidden
896 (but we don't try the slow path to filter out hidden nodes for now)
901 (but we don't try the slow path to filter out hidden nodes for now)
897
902
General Comments 0
You need to be logged in to leave comments. Login now