[PATCH] hgweb: display fate of obsolete changesets

Anton Shestakov av6 at dwimlabs.net
Mon Dec 4 10:08:32 EST 2017


On Sun, 03 Dec 2017 18:49:55 +0100
Boris Feld <boris.feld at octobus.net> wrote:

> Catching back on my emails.
> 
> I thought obsfateprinter was not dependent on the template system but I
> was wrong. It doesn't seems too hard to make obsfate printer
> independent of the templating system.

It's not exactly dependent, it's just that everywhere it's used (just
one place at the moment) it takes output of showsuccsandmarkers(),
which lives in templatekw. That function is not short, so it made sense
to reuse it.

> Just checking that we are all on the same page, should we update the
> current obsfateprinter to manually format and render an obsfate line?
> Or do we create another utility that is not template-dependent that
> could also be called by changeset_printer?

No idea, I'll probably just try and render obsfate in hgweb without
depending on the obsfateprinter, since this didn't turn out to be a
trivial patch.

> Also, do we agree on the general format of obsfate as is it today?
> 
>     Obsfate: rewritten using amend as 2:fdf9bde5129a by test (at 1970-
> 01-01 00:00 +0000)
>     Obsfate: rewritten using amend as 3:65b757b745b9 by test (at 1970-
> 01-01 00:00 +0000)

FWIW, this does look fine, but also shows how obsfateprinter can't fit
every need: hgweb would need the hashes to be links.

So yes, this patch can be dropped.

> On Thu, 2017-11-30 at 16:08 -0500, Augie Fackler wrote:
> > (+boris explicitly to try and get his attention)
> > 
> > On Sun, Nov 26, 2017 at 08:10:14PM +0900, Yuya Nishihara wrote:  
> > > On Tue, 21 Nov 2017 18:14:42 +0800, Anton Shestakov wrote:  
> > > > # HG changeset patch
> > > > # User Anton Shestakov <av6 at dwimlabs.net>
> > > > # Date 1511255021 -28800
> > > > #      Tue Nov 21 17:03:41 2017 +0800
> > > > # Node ID f8e398c42760482f02e6cfb6b8a1e6a752564c95
> > > > # Parent  ff80efc8f3e469c90376603af4fa39012f328918
> > > > # EXP-Topic hgweb-more-info
> > > > hgweb: display fate of obsolete changesets
> > > > diff --git a/mercurial/hgweb/webutil.py
> > > > b/mercurial/hgweb/webutil.py
> > > > --- a/mercurial/hgweb/webutil.py
> > > > +++ b/mercurial/hgweb/webutil.py
> > > > @@ -28,10 +28,12 @@ from .. import (
> > > >      error,
> > > >      match,
> > > >      mdiff,
> > > > +    obsutil,
> > > >      patch,
> > > >      pathutil,
> > > >      pycompat,
> > > >      templatefilters,
> > > > +    templatekw,
> > > >      ui as uimod,
> > > >      util,
> > > >  )
> > > > @@ -351,6 +353,10 @@ def linerange(req):
> > > >  def formatlinerange(fromline, toline):
> > > >      return '%d:%d' % (fromline + 1, toline)
> > > > 
> > > > +def obsfate(repo, ctx, ui):
> > > > +    return [obsutil.obsfateprinter(x['successors'],
> > > > x['markers'], ui)
> > > > +            for x in templatekw.showsuccsandmarkers(repo, ctx)]  
> > > 
> > > Maybe we should first refactor obsfate utility to not depend on
> > > templatekw.
> > > Boris, any progress on this?
> > > _______________________________________________
> > > Mercurial-devel mailing list
> > > Mercurial-devel at mercurial-scm.org
> > > https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel  



More information about the Mercurial-devel mailing list