Show More
@@ -1542,31 +1542,22 class revlog(object): | |||
|
1542 | 1542 | length = max(self.index.shortest(node), minlength) |
|
1543 | 1543 | return disambiguate(hexnode, length) |
|
1544 | 1544 | except RevlogError: |
|
1545 | if node != wdirid: | |
|
1546 | raise LookupError(node, self.indexfile, _('no node')) | |
|
1547 | except AttributeError: | |
|
1548 | # Fall through to pure code | |
|
1549 | pass | |
|
1550 | ||
|
1545 | 1551 |
|
|
1546 | 1552 |
|
|
1547 | 1553 |
|
|
1548 | 1554 |
|
|
1549 | 1555 |
|
|
1550 | else: | |
|
1551 | raise LookupError(node, self.indexfile, _('no node')) | |
|
1552 | except AttributeError: | |
|
1553 | # Fall through to pure code | |
|
1554 | pass | |
|
1555 | ||
|
1556 | shortest = hexnode | |
|
1557 | startlength = max(6, minlength) | |
|
1558 | length = startlength | |
|
1559 | while True: | |
|
1556 | ||
|
1557 | for length in range(minlength, 41): | |
|
1560 | 1558 | prefix = hexnode[:length] |
|
1561 | 1559 | if isvalid(prefix): |
|
1562 | shortest = prefix | |
|
1563 | if length == minlength or length > startlength: | |
|
1564 | return shortest | |
|
1565 | length -= 1 | |
|
1566 | else: | |
|
1567 | length += 1 | |
|
1568 | if len(shortest) <= length: | |
|
1569 | return shortest | |
|
1560 | return disambiguate(hexnode, length) | |
|
1570 | 1561 | |
|
1571 | 1562 | def cmp(self, node, text): |
|
1572 | 1563 | """compare text with a given file revision |
General Comments 0
You need to be logged in to leave comments.
Login now