revset: fix traceback for bogus revisions in id(rev) stable
authorMatt Harbison <matt_harbison@yahoo.com>
Mon, 14 May 2012 19:25:13 -0400
branchstable
changeset 16735 47b8ec0eb7fb
parent 16734 3c398032bf46
child 16736 025b3b763ba9
revset: fix traceback for bogus revisions in id(rev) hg log -r "id(1234567)" now returns an empty list like rev() does.
mercurial/revset.py
--- a/mercurial/revset.py	Tue May 15 12:44:07 2012 +0200
+++ b/mercurial/revset.py	Mon May 14 19:25:13 2012 -0400
@@ -740,7 +740,11 @@
     if len(n) == 40:
         rn = repo[n].rev()
     else:
-        rn = repo.changelog.rev(repo.changelog._partialmatch(n))
+        rn = None
+        pm = repo.changelog._partialmatch(n)
+        if pm is not None:
+            rn = repo.changelog.rev(pm)
+
     return [r for r in subset if r == rn]
 
 def outgoing(repo, subset, x):