Mercurial > hg
comparison mercurial/templater.py @ 32684:af854b1b36f8
revlog: add support for partial matching of wdir node id
The idea is simple. If the given node id prefix is 'ff...f', add +1 to the
number of matches (e.g. ambiguous if partial + maybewdir > 1).
This patch also fixes id() revset and shortest() template since _partialmatch()
can raise WdirUnsupported exception.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Fri, 19 Aug 2016 18:26:04 +0900 |
parents | 52e222eef646 |
children | 2ecce24dfcd3 |
comparison
equal
deleted
inserted
replaced
32683:9f840d99054c | 32684:af854b1b36f8 |
---|---|
958 return False | 958 return False |
959 except ValueError: | 959 except ValueError: |
960 return True | 960 return True |
961 except error.RevlogError: | 961 except error.RevlogError: |
962 return False | 962 return False |
963 except error.WdirUnsupported: | |
964 # single 'ff...' match | |
965 return True | |
963 | 966 |
964 shortest = node | 967 shortest = node |
965 startlength = max(6, minlength) | 968 startlength = max(6, minlength) |
966 length = startlength | 969 length = startlength |
967 while True: | 970 while True: |