[PATCH 1 of 5] changelog: introduce a 'tiprev' method

Jordi Gutiérrez Hermoso jordigh at octave.org
Thu Jan 18 15:40:26 UTC 2018


On Wed, 2018-01-17 at 19:33 +0100, Boris Feld wrote:
> # HG changeset patch
> # User Boris Feld <boris.feld at octobus.net>
> # Date 1493857401 -7200
> #      Thu May 04 02:23:21 2017 +0200
> # Node ID e3bb410037a49980a8316e4e5a49ab23ea978047
> # Parent  0e369eca888fc80ee980fe8200c59dc7b0024dae
> # EXP-Topic tiprev
> # Available At https://bitbucket.org/octobus/mercurial-devel/
> #              hg pull https://bitbucket.org/octobus/mercurial-devel/
>  -r e3bb410037a4
> changelog: introduce a 'tiprev' method
> 
> Accessing tiprev is a common need through the code base. It is
> usually done using "len(changelog) -1". That form is tedious and
> error-prone. For example, it will give wrong results on filtered
> changelog (if the unfiltered tip is filtered).

Funny, I had this very need yesterday, and I needed it cached, so I
did this instead:

http://mercurial.markmail.org/search/list:com.selenic.mercurial-devel#q
uery:list%3Acom.selenic.mercurial-
devel+page:1+mid:6mqe6sjrsmuixcbe+state:results




More information about the Mercurial-devel mailing list