[PATCH V2] revset: support ranges in #generations relation

Yuya Nishihara yuya at tcha.org
Thu Jan 17 05:59:04 EST 2019


On Thu, 17 Jan 2019 16:22:05 +0800, Anton Shestakov wrote:
> On Wed, 16 Jan 2019 23:18:38 +0900
> Yuya Nishihara <yuya at tcha.org> wrote:
> 
> > On Wed, 16 Jan 2019 18:29:57 +0800, Anton Shestakov wrote:
> > > # HG changeset patch
> > > # User Anton Shestakov <av6 at dwimlabs.net>
> > > # Date 1547564229 -28800
> > > #      Tue Jan 15 22:57:09 2019 +0800
> > > # Node ID 039a0d0d913afac1464bfc1ea8a49b22e803b081
> > > # Parent  8aca89a694d4bd7d25877b3652fb83e187ea1802
> > > revset: support ranges in #generations relation
> > 
> > The idea sounds good to me.
> > 
> > > +def generationsrel(repo, subset, x, rel, a, b, order):
> > > +    # TODO: rewrite tests, and drop startdepth argument from ancestors() and
> > > +    # descendants() predicates
> > > +    if a < 0 or a is None:
> > 
> > Need to test "is None" first. "None < 0" doesn't work on Py3.
> 
> Right, fixed.
> 
> > > +        if b >= 0 or b is None:
> > > +            startdepth = 1
> > 
> > Maybe startdepth = 0?
> 
> Given foo#g[-1:1], startdepth=0 everywhere would include foo in both
> aset and dset, so I do startdepth=1 in one case.

That doesn't matter since duplicated revisions will be filtered out by
smartset.addset.


More information about the Mercurial-devel mailing list