diff -r 846920d89476 -r 497cedcb6504 hgext/git/gitlog.py --- a/hgext/git/gitlog.py Tue Apr 27 00:26:12 2021 -0400 +++ b/hgext/git/gitlog.py Tue Apr 27 12:31:30 2021 -0400 @@ -159,8 +159,11 @@ def tiprev(self): t = self._db.execute( 'SELECT rev FROM changelog ' 'ORDER BY REV DESC ' 'LIMIT 1' - ) - return next(t) + ).fetchone() + + if t is not None: + return t[0] + return -1 def _partialmatch(self, id): if wdirhex.startswith(id):