Mercurial > public > mercurial-scm > hg
comparison hgext/git/gitlog.py @ 45925: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 | e7587430ca23 |
children | 66f6ca2b7aee |
comparison
equal
deleted
inserted
replaced
45924:a2eda1ff22aa | 45925:6aacc39501f7 |
---|---|
145 'WHERE rev >= ? AND rev <= ? ' | 145 'WHERE rev >= ? AND rev <= ? ' |
146 'ORDER BY REV ASC', | 146 'ORDER BY REV ASC', |
147 (start, stop), | 147 (start, stop), |
148 ) | 148 ) |
149 return (int(r[0]) for r in t) | 149 return (int(r[0]) for r in t) |
150 | |
151 def tiprev(self): | |
152 t = self._db.execute( | |
153 'SELECT rev FROM changelog ' | |
154 'ORDER BY REV DESC ' | |
155 'LIMIT 1' | |
156 ) | |
157 return next(t) | |
150 | 158 |
151 def _partialmatch(self, id): | 159 def _partialmatch(self, id): |
152 if nodemod.wdirhex.startswith(id): | 160 if nodemod.wdirhex.startswith(id): |
153 raise error.WdirUnsupported | 161 raise error.WdirUnsupported |
154 candidates = [ | 162 candidates = [ |