Mercurial > public > mercurial-scm > hg
diff mercurial/revset.py @ 24904:b5c227f3e461 stable
revset: id() called with 40-byte strings should give the same results as for short strings
The patch solves two issues:
1. id(unknown_full_hash) aborts, but id(unknown_short_hash) doesn't
2. id(40byte_tag_or_bookmark) returns tagged/bookmarked revision,
but id(non-40byte_tag_or_bookmark) doesn't
After the patch:
1. id(unknown_full_hash) doesn't abort
2. id(40byte_tag_or_bookmark) returns empty set
author | Alexander Drozdov <al.drozdov@gmail.com> |
---|---|
date | Mon, 20 Apr 2015 10:52:20 +0300 |
parents | 077683371b7b |
children | e5f166961123 8b99e9a8db05 |
line wrap: on
line diff
--- a/mercurial/revset.py Sun May 03 17:33:14 2015 +0900 +++ b/mercurial/revset.py Mon Apr 20 10:52:20 2015 +0300 @@ -1294,7 +1294,10 @@ # i18n: "id" is a keyword n = getstring(l[0], _("id requires a string")) if len(n) == 40: - rn = repo[n].rev() + try: + rn = repo.changelog.rev(node.bin(n)) + except (LookupError, TypeError): + rn = None else: rn = None pm = repo.changelog._partialmatch(n)