[PATCH 3 of 4] log: add a marker for closed heads

Matt Mackall mpm at selenic.com
Sun May 9 16:37:27 CDT 2010


> # HG changeset patch
> # User Gilles Moris <gilles.moris at free.fr>
> # Date 1273437800 -7200
> # Node ID 4f227e0671ba95e075ecdc2d2a6b5f3f0072e5bf
> # Parent  3615f282d6f08fb99976b86816ff37c019b8187a
> log: add a marker for closed heads

Hey folks, when you send a patch like this, -please- show us what it
looks like right up front, not way down in some tests.

This one is scary. Lots of people parse 'hg log' and a new thingy
showing up there where there's never been one before is liable to break
things. There are like dozens of GUI tools and IDE plug-ins these days
and it's a sure bet that one of them will break, never mind all the
home-grown scripts that are doing something with log output.

> diff -r 3615f282d6f0 -r 4f227e0671ba mercurial/cmdutil.py
> --- a/mercurial/cmdutil.py	Sun May 09 22:42:06 2010 +0200
> +++ b/mercurial/cmdutil.py	Sun May 09 22:43:20 2010 +0200
> @@ -737,8 +737,10 @@
>          parents = [(p, hexfunc(log.node(p)))
>                     for p in self._meaningful_parentrevs(log, rev)]
>  
> -        self.ui.write(_("changeset:   %d:%s\n") % (rev, hexfunc(changenode)),
> +        self.ui.write(_("changeset:   %d:%s") % (rev, hexfunc(changenode)),
>                        label='log.changeset')
> +        self.ui.write(templatekw.showclosed(ctx=ctx), label='log.closed')

Calling into the templater code in the non-template path is not great.

> und on branches b
> -changeset:   12:2da6583810df
> +changeset:   12:2da6583810df (closed)
>  branch:      b

Seems it should be attached to branch: instead, setting aside the output
stability issue for a moment.

-- 
Mathematics is the supreme nostalgia of our time.




More information about the Mercurial-devel mailing list