Mercurial > public > mercurial-scm > hg
comparison hgext/git/gitlog.py @ 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 | f8fa7ec53517 |
comparison
equal
deleted
inserted
replaced
47049:2a77c817d451 | 47050:ce24a00fe7f0 |
---|---|
66 raise error.LookupError(r, b'00changelog.i', _(b'no node')) | 66 raise error.LookupError(r, b'00changelog.i', _(b'no node')) |
67 return bin(t[0]) | 67 return bin(t[0]) |
68 | 68 |
69 def hasnode(self, n): | 69 def hasnode(self, n): |
70 t = self._db.execute( | 70 t = self._db.execute( |
71 'SELECT node FROM changelog WHERE node = ?', (n,) | 71 'SELECT node FROM changelog WHERE node = ?', |
72 (pycompat.sysstr(n),), | |
72 ).fetchone() | 73 ).fetchone() |
73 return t is not None | 74 return t is not None |
74 | 75 |
75 | 76 |
76 class baselogindex(object): | 77 class baselogindex(object): |