changeset 45940:6aacc39501f7

gitlog: add tiprev() function Lots of stuff was broken because this was missing. Differential Revision: https://phab.mercurial-scm.org/D9402
author Augie Fackler <raf@durin42.com>
date Wed, 25 Nov 2020 22:23:23 -0500
parents a2eda1ff22aa
children a6f2821cdeab
files hgext/git/gitlog.py
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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