[PATCH 7 of 9 V3] template: compute dates in obsfatedate
Boris Feld
boris.feld at octobus.net
Wed Aug 23 10:32:01 EDT 2017
On Wed, 2017-08-23 at 00:10 +0900, Yuya Nishihara wrote:
> On Mon, 21 Aug 2017 10:43:59 +0200, Boris Feld wrote:
> > # HG changeset patch
> > # User Boris Feld <boris.feld at octobus.net>
> > # Date 1499088850 -7200
> > # Mon Jul 03 15:34:10 2017 +0200
> > # Node ID faad6d683f7a30996007116d296df9ebf853c44d
> > # Parent 2fee3b06f7b09f35dcfa312b645cf94090c11fb9
> > # EXP-Topic obsfatetemplate
> > template: compute dates in obsfatedate
> >
> > Extract the dates from obsmarkers. Compute the min and max date
> > from the
> > obsmarker range list.
> >
> > diff -r 2fee3b06f7b0 -r faad6d683f7a mercurial/obsutil.py
> > --- a/mercurial/obsutil.py Mon Jul 03 15:34:00 2017 +0200
> > +++ b/mercurial/obsutil.py Mon Jul 03 15:34:10 2017 +0200
> > @@ -591,6 +591,20 @@
> >
> > return {'users': sorted(users)}
> >
> > +def _successorsetdates(successorset, markers):
> > + """returns the max date and the min date of the markers list
> > + """
> > +
> > + if not markers:
> > + return {}
> > +
> > + dates = [m[4] for m in markers]
> > +
> > + return {
> > + 'min_date': min(dates),
> > + 'max_date': max(dates)
> > + }
>
> Perhaps we'll want a list of dates, min(), and max() functions?
>
> "{min(markers % date)}"
> ^^^^^^^
> not work currently, so we'll probably need a function
> to
> extract 'date' fields from markers.
Good idea, I will send a V4 with these modifications.
More information about the Mercurial-devel
mailing list