Show More
@@ -12,6 +12,7 b' import re' | |||
|
12 | 12 | from .i18n import _ |
|
13 | 13 | from .node import ( |
|
14 | 14 | bin, |
|
15 | wdirid, | |
|
15 | 16 | ) |
|
16 | 17 | from . import ( |
|
17 | 18 | color, |
@@ -601,7 +602,9 b' def shortest(context, mapping, args):' | |||
|
601 | 602 | else: |
|
602 | 603 | try: |
|
603 | 604 | node = scmutil.resolvehexnodeidprefix(repo, hexnode) |
|
604 |
except |
|
|
605 | except error.WdirUnsupported: | |
|
606 | node = wdirid | |
|
607 | except error.LookupError: | |
|
605 | 608 | return hexnode |
|
606 | 609 | if not node: |
|
607 | 610 | return hexnode |
@@ -3916,6 +3916,15 b' Test shortest(node) function:' | |||
|
3916 | 3916 | $ hg log --template '{shortest("not a hex string, but it'\''s 40 bytes long")}\n' -l1 |
|
3917 | 3917 | not a hex string, but it's 40 bytes long |
|
3918 | 3918 | |
|
3919 | $ hg log --template '{shortest("ffffffffffffffffffffffffffffffffffffffff")}\n' -l1 | |
|
3920 | ffff | |
|
3921 | ||
|
3922 | $ hg log --template '{shortest("fffffff")}\n' -l1 | |
|
3923 | ffff | |
|
3924 | ||
|
3925 | $ hg log --template '{shortest("ff")}\n' -l1 | |
|
3926 | ffff | |
|
3927 | ||
|
3919 | 3928 | $ cd .. |
|
3920 | 3929 | |
|
3921 | 3930 | Test shortest(node) with the repo having short hash collision: |
General Comments 0
You need to be logged in to leave comments.
Login now