D10526: git: pass the correct type to the sqlite3 query for baselog.hasnode()
mharbison72 (Matt Harbison)
phabricator at mercurial-scm.org
Wed Apr 28 15:08:28 UTC 2021
mharbison72 created this revision.
Herald added a reviewer: durin42.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.
pulkit accepted this revision.
This revision is now accepted and ready to land.
REVISION SUMMARY
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.
REPOSITORY
rHG Mercurial
BRANCH
stable
REVISION DETAIL
https://phab.mercurial-scm.org/D10526
AFFECTED FILES
hgext/git/gitlog.py
CHANGE DETAILS
diff --git a/hgext/git/gitlog.py b/hgext/git/gitlog.py
--- a/hgext/git/gitlog.py
+++ b/hgext/git/gitlog.py
@@ -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
To: mharbison72, durin42, #hg-reviewers
Cc: mercurial-patches, mercurial-devel
More information about the Mercurial-devel
mailing list