Proposing compact graph log

Gregory Szorc gregory.szorc at gmail.com
Mon Jun 2 11:16:46 CDT 2014


On 6/1/14, 1:58 PM, Santiago Payà i Miralta wrote:
> Hello,
>
> I would ask for a review of the --graph log option. When using --graph
> with a --template the resulting DAG chain always shows the changesets
> connected by a row of vertical edges '|', regardless of using '\n' or
> not in the --template parameter:
>
> $ hg log -G --template={rev} -l 3
> @  21644
> |
> o  21643
> |
> o  21642
> |
>
> And what is proposed is:
>
> $ hg log -G --template={rev} -l 3
> @  21644
> o  21643
> o  21642
>
> You can see my point of view detailed in this blog [1].
>
> There are some problems with this change:
>
> * Breaks some (57) tests :(
> * Could depend from an option to the log command, some as --compact or
> similar, in this way the previous behavior would not be broken.
> * Works filtering the resulting graph, may be should work in the graph
> generation (?). About the code be aware that, in my opinion, the comment
> in line graphmod:327[2] is not true, the `shift_interline' list contains
> all non-vertical _and_ vertical edges.
>
> Well, this is just a proposal that if deemed correct should be
> developed. Was it discussed at some point when the graphlog extension ?
>
> Best regards,
>
> Santiago
>
> [1] http://print--hello--world.blogspot.com.es/2014_05_01_archive.html
> [2] http://selenic.com/hg/file/9c35f3a8cac4/mercurial/graphmod.py#l327

I've long wanted a more compact graph view like you've proposed. The 
examples on your blog are exactly what I'm looking for!

I hear the concerns that this breaks backwards compatibility. 
Personally, I'm not sure why machines would attempt to parse the 
graphical output. Surely any machine that cares about the graph 
structure of a repository is parsing the output of a custom template 
that prints {parents} or some such? But, backwards compatibility is 
backwards compatibility. Perhaps we should land this behind a config flag.


More information about the Mercurial-devel mailing list