gitlog: add tiprev() function
authorAugie Fackler <raf@durin42.com>
Wed, 25 Nov 2020 22:23:23 -0500
changeset 45940 6aacc39501f7
parent 45939 a2eda1ff22aa
child 45941 a6f2821cdeab
gitlog: add tiprev() function Lots of stuff was broken because this was missing. Differential Revision: https://phab.mercurial-scm.org/D9402
hgext/git/gitlog.py
--- a/hgext/git/gitlog.py	Tue Nov 24 17:49:16 2020 +0100
+++ b/hgext/git/gitlog.py	Wed Nov 25 22:23:23 2020 -0500
@@ -148,6 +148,14 @@
         )
         return (int(r[0]) for r in t)
 
+    def tiprev(self):
+        t = self._db.execute(
+            'SELECT rev FROM changelog '
+            'ORDER BY REV DESC '
+            'LIMIT 1'
+        )
+        return next(t)
+
     def _partialmatch(self, id):
         if nodemod.wdirhex.startswith(id):
             raise error.WdirUnsupported