changeset 7062:efc579fdaf69

provide nicer feedback when an unknown node id is passed to a command Previously, an unknown node id would lead to the following error: abort: 00changelog.i@343445453433: no node! All other unknown revision would instead display as: abort: unknown revision '343445453'! The former error message has been suppressed in favor of the latter.
author Sune Foldager <cryo@cyanite.org>
date Sat, 04 Oct 2008 10:14:39 +0200
parents 8b874f8cd29f
children 582dac23ebac
files mercurial/revlog.py tests/test-log tests/test-log.out
diffstat 3 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/revlog.py	Thu Oct 02 16:22:02 2008 +0200
+++ b/mercurial/revlog.py	Sat Oct 04 10:14:39 2008 +0200
@@ -852,7 +852,7 @@
                 node = bin(id)
                 r = self.rev(node)
                 return node
-            except TypeError:
+            except (TypeError, LookupError):
                 pass
 
     def _partialmatch(self, id):
--- a/tests/test-log	Thu Oct 02 16:22:02 2008 +0200
+++ b/tests/test-log	Sat Oct 04 10:14:39 2008 +0200
@@ -98,4 +98,7 @@
 echo '% log -r ""'
 hg log -r ''
 
+echo '% log -r <some unknown node id>'
+hg log -r 1000000000000000000000000000000000000000
+
 exit 0
--- a/tests/test-log.out	Thu Oct 02 16:22:02 2008 +0200
+++ b/tests/test-log.out	Sat Oct 04 10:14:39 2008 +0200
@@ -223,3 +223,5 @@
 
 % log -r ""
 abort: 00changelog.i@: ambiguous identifier!
+% log -r <some unknown node id>
+abort: unknown revision '1000000000000000000000000000000000000000'!