changeset 16735:47b8ec0eb7fb stable

revset: fix traceback for bogus revisions in id(rev) hg log -r "id(1234567)" now returns an empty list like rev() does.
author Matt Harbison <matt_harbison@yahoo.com>
date Mon, 14 May 2012 19:25:13 -0400
parents 3c398032bf46
children 025b3b763ba9
files mercurial/revset.py
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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):