D9402: gitlog: add tiprev() function

durin42 (Augie Fackler) phabricator at mercurial-scm.org
Thu Nov 26 06:35:22 UTC 2020


durin42 created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  Lots of stuff was broken because this was missing.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D9402

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
@@ -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



To: durin42, #hg-reviewers
Cc: mercurial-patches, mercurial-devel


More information about the Mercurial-devel mailing list