changeset 52654:7d2fc79a3e5a

git: consistify & fix LookupError messages This includes 3 one-line fixes: 1. use the "no node" message instead of "no such node" for consistency 2. drop superfluous (and wrong & unused) %d format string token 3. correct one message to "no rev" since it indicates a rev that wasn't found
author Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
date Sat, 04 Jan 2025 08:45:28 -0500
parents 3865451a5fab
children 70b523d7a60d
files hgext/git/gitlog.py
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/git/gitlog.py	Fri Oct 04 10:25:24 2024 -0400
+++ b/hgext/git/gitlog.py	Sat Jan 04 08:45:28 2025 -0500
@@ -139,7 +139,7 @@
             'SELECT rev FROM changelog WHERE node = ?', (gitutil.togitnode(n),)
         ).fetchone()
         if t is None:
-            raise error.LookupError(n, b'00changelog.i', _(b'no node %d'))
+            raise error.LookupError(n, b'00changelog.i', _(b'no node'))
         return t[0]
 
     def node(self, r):
@@ -149,7 +149,7 @@
             'SELECT node FROM changelog WHERE rev = ?', (r,)
         ).fetchone()
         if t is None:
-            raise error.LookupError(r, b'00changelog.i', _(b'no node'))
+            raise error.LookupError(r, b'00changelog.i', _(b'no rev'))
         return bin(t[0])
 
     def synthetic(self, n):
@@ -633,7 +633,7 @@
             (pycompat.fsdecode(self.path), gitutil.togitnode(node)),
         ).fetchone()
         if row is None:
-            raise error.LookupError(self.path, node, _(b'no such node'))
+            raise error.LookupError(self.path, node, _(b'no node'))
         return int(row[0])
 
     def node(self, rev):