equal
deleted
inserted
replaced
762 # i18n: "shortest" is a keyword |
762 # i18n: "shortest" is a keyword |
763 _(b"shortest() expects an integer minlength"), |
763 _(b"shortest() expects an integer minlength"), |
764 ) |
764 ) |
765 |
765 |
766 repo = context.resource(mapping, b'repo') |
766 repo = context.resource(mapping, b'repo') |
767 if len(hexnode) > 40: |
767 hexnodelen = 2 * repo.nodeconstants.nodelen |
|
768 if len(hexnode) > hexnodelen: |
768 return hexnode |
769 return hexnode |
769 elif len(hexnode) == 40: |
770 elif len(hexnode) == hexnodelen: |
770 try: |
771 try: |
771 node = bin(hexnode) |
772 node = bin(hexnode) |
772 except TypeError: |
773 except TypeError: |
773 return hexnode |
774 return hexnode |
774 else: |
775 else: |