[PATCH 4 of 4] revlog: reuse 'descendant' implemention in 'isancestor'

Boris FELD boris.feld at octobus.net
Tue Jul 3 06:05:51 EDT 2018


On 02/07/2018 18:37, Martin von Zweigbergk via Mercurial-devel wrote:
>
>
> On Mon, Jul 2, 2018 at 5:05 AM Yuya Nishihara <yuya at tcha.org 
> <mailto:yuya at tcha.org>> wrote:
>
>     On Sun, 01 Jul 2018 08:38:42 +0200, Paul Morelle wrote:
>     > # HG changeset patch
>     > # User Boris Feld <boris.feld at octobus.net
>     <mailto:boris.feld at octobus.net>>
>     > # Date 1529622442 -3600
>     > #      Fri Jun 22 00:07:22 2018 +0100
>     > # Node ID 6bfe8fc36b4e20fcdf6cc49fe9ddb6e79bcf213f
>     > # Parent  5ea9c5d20ecc1aac2aecdd4c0902b3cd470b04d5
>     > # EXP-Topic descendant
>     > # Available At https://bitbucket.org/octobus/mercurial-devel/
>     > #              hg pull
>     https://bitbucket.org/octobus/mercurial-devel/ -r 6bfe8fc36b4e
>     > revlog: reuse 'descendant' implemention in 'isancestor'
>
>     Queued the series, thanks.
>
>     > We should probably cleanup the API at some point to avoid having
>     so many similar
>     > functions. However, we focus on an efficient implementation for now.
>
>     Yeah.
>
>
> Perhaps we should rename "descendant" to "isdescendant" to match 
> "isancestor" then.

Having `isdescendant` and `isancestor` sharing the same signature and 
behavior except for their arguments types (one accepting revs and the 
other accepting nodes) seems confusing.

We could maybe use the `rev(s)` prefix, giving for example 
`isancestorrev` and `commonancestorheadrevs`. This prefix is already 
used in the code base:

* revlog.parentrevs
* revlog.findcommonmissing vs revlog.findmissingrevs
* revlog.heads vs revlog.headrevs
* revlog.incrementalmissingrevs

>
>
>
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.mercurial-scm.org/pipermail/mercurial-devel/attachments/20180703/d6661494/attachment.html>


More information about the Mercurial-devel mailing list