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
--- 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