Mercurial > hg
comparison mercurial/node.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 | bd872f64a8ba |
children | f574cc00831a |
comparison
equal
deleted
inserted
replaced
32683:9f840d99054c | 32684:af854b1b36f8 |
---|---|
27 | 27 |
28 # pseudo identifiers for working directory | 28 # pseudo identifiers for working directory |
29 # (they are experimental, so don't add too many dependencies on them) | 29 # (they are experimental, so don't add too many dependencies on them) |
30 wdirrev = 0x7fffffff | 30 wdirrev = 0x7fffffff |
31 wdirid = b"\xff" * 20 | 31 wdirid = b"\xff" * 20 |
32 wdirhex = hex(wdirid) | |
32 | 33 |
33 def short(node): | 34 def short(node): |
34 return hex(node[:6]) | 35 return hex(node[:6]) |