diff hgext/git/gitlog.py @ 47017:497cedcb6504 stable

git: make changelog.tiprev() return int instead of tuple (issue6510) Differential Revision: https://phab.mercurial-scm.org/D10522
author Matt Harbison <matt_harbison@yahoo.com>
date Tue, 27 Apr 2021 12:31:30 -0400
parents 846920d89476
children 03c73fc6f89a
line wrap: on
line diff
--- 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):