Show More
@@ -763,15 +763,22 b' class revlog(object):' | |||
|
763 | 763 | return self.node(rev) |
|
764 | 764 | except (ValueError, OverflowError): |
|
765 | 765 | pass |
|
766 | try: | |
|
766 | 767 | # hex(node)[:...] |
|
768 | if len(id) % 2 == 0: | |
|
769 | bin_id = bin(id) | |
|
770 | else: | |
|
771 | bin_id = bin(id[:-1]) | |
|
767 | 772 | node = None |
|
768 | 773 | for n in self.nodemap: |
|
769 | if hex(n).startswith(id): | |
|
774 | if n.startswith(bin_id) and hex(n).startswith(id): | |
|
770 | 775 | if node is not None: |
|
771 | 776 | raise RevlogError(_("Ambiguous identifier")) |
|
772 | 777 | node = n |
|
773 | 778 | if node is not None: |
|
774 | 779 | return node |
|
780 | except TypeError: | |
|
781 | pass | |
|
775 | 782 | |
|
776 | 783 | # might need fixing if we change hash lengths |
|
777 | 784 | if len(id) == 20 and id in self.nodemap: |
General Comments 0
You need to be logged in to leave comments.
Login now