[PATCH 9 of 9] template: use template-engine for obsfate

Jun Wu quark at fb.com
Thu Jul 13 12:11:19 EDT 2017


Excerpts from Jun Wu's message of 2017-07-13 08:42:11 -0700:
> Excerpts from Boris Feld's message of 2017-07-13 12:32:39 +0200:
> > I think there was a misunderstanding about obsfate that I will try to
> > clarify, this email is a bit long, sorry.
> > 
> > TL;DR:
> > - hg log is a changeset-centric command
> > - obsfate template summarize the obs-history between a changeset and
> > its successors, history that can span several obs-markers
> 
> I agree a function is needed to work with multiple obsmarkers. But I don't
> think the current obsfate implementation is a good design.
> 
> I think that function's input is (src, [dest=(not hidden())]), output is
> multiple obsmarkers. The user could choose what to do with a list of ordered
> obsmarkers. Like, if they want to display the entire chain of markers, they
> should be able to do it. If they want to summarize things, we could provide
> "dedup", "if_unique" helper function to allow them to do so.

To minimize the work needed, I think we can:

  1. Add something to return a list of markers that can be used in templates
     directly. (Maybe a list of list if we want to want to deal with the
     divergence case well)
  2. Make obsfate accepts a list of markers (the output of the above
     function), and returns summarized results that can also be used in
     templates.

So "obsfate" is the "helper function" that summarize things, while the user
still have the flexibility of rendering markers in details.

> [...]


More information about the Mercurial-devel mailing list