From patchwork Thu Nov 26 06:35:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: D9402: gitlog: add tiprev() function From: phabricator X-Patchwork-Id: 47681 Message-Id: To: Phabricator Cc: mercurial-devel@mercurial-scm.org Date: Thu, 26 Nov 2020 06:35:22 +0000 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 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