changeset 47050:ce24a00fe7f0 stable

git: pass the correct type to the sqlite3 query for baselog.hasnode() It looks like this function is mostly used in exchange (which isn't supported now) and histedit (which crashes). But I did verify in a REPL that passing bytes to `db.execute()` fails to find the row, whereas passing str works. Differential Revision: https://phab.mercurial-scm.org/D10526
author Matt Harbison <matt_harbison@yahoo.com>
date Tue, 27 Apr 2021 17:54:08 -0400
parents 2a77c817d451
children de26b9a7ec29
files hgext/git/gitlog.py
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/git/gitlog.py	Tue Apr 27 17:11:55 2021 -0400
+++ b/hgext/git/gitlog.py	Tue Apr 27 17:54:08 2021 -0400
@@ -68,7 +68,8 @@
 
     def hasnode(self, n):
         t = self._db.execute(
-            'SELECT node FROM changelog WHERE node = ?', (n,)
+            'SELECT node FROM changelog WHERE node = ?',
+            (pycompat.sysstr(n),),
         ).fetchone()
         return t is not None