Patchwork D9402: gitlog: add tiprev() function

login
register
mail settings
Submitter phabricator
Date Nov. 26, 2020, 6:35 a.m.
Message ID <differential-rev-PHID-DREV-n7yg25jkj7lpqxb4bddm-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/47681/
State Superseded
Headers show

Comments

phabricator - Nov. 26, 2020, 6:35 a.m.
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




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

Patch

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