comparison hgext/git/gitlog.py @ 47017:497cedcb6504 stable

git: make changelog.tiprev() return int instead of tuple (issue6510) Differential Revision: https://phab.mercurial-scm.org/D10522
author Matt Harbison <matt_harbison@yahoo.com>
date Tue, 27 Apr 2021 12:31:30 -0400
parents 846920d89476
children 03c73fc6f89a
comparison
equal deleted inserted replaced
47016:846920d89476 47017:497cedcb6504
157 return (int(r[0]) for r in t) 157 return (int(r[0]) for r in t)
158 158
159 def tiprev(self): 159 def tiprev(self):
160 t = self._db.execute( 160 t = self._db.execute(
161 'SELECT rev FROM changelog ' 'ORDER BY REV DESC ' 'LIMIT 1' 161 'SELECT rev FROM changelog ' 'ORDER BY REV DESC ' 'LIMIT 1'
162 ) 162 ).fetchone()
163 return next(t) 163
164 if t is not None:
165 return t[0]
166 return -1
164 167
165 def _partialmatch(self, id): 168 def _partialmatch(self, id):
166 if wdirhex.startswith(id): 169 if wdirhex.startswith(id):
167 raise error.WdirUnsupported 170 raise error.WdirUnsupported
168 candidates = [ 171 candidates = [