[PATCH] pullrequest/compare: add logical changeset index to clarify the order

Mads Kiilerich mads at kiilerich.com
Fri May 15 17:26:48 EDT 2015


On 05/13/2015 09:25 PM, Thomas De Schampheleire wrote:
> # HG changeset patch
> # User Thomas De Schampheleire <thomas.de.schampheleire at gmail.com>
> # Date 1431287504 -7200
> #      Sun May 10 21:51:44 2015 +0200
> # Node ID e19127e4040d1817bbec77118ca7377644f76a64
> # Parent  6e8effd028bf41a132aee02e52ffc0bf990dadf4
> pullrequest/compare: add logical changeset index to clarify the order
>
> Is the parent-most changeset in a changeset the one at the top or at the
> bottom? When the revision numbers are not shown, it is not obvious to
> determine this.
>
> This commit adds a logical changeset index to the commit list in a
> pullrequest or compare view. The index starts at 1 (the parent-most commit)
> and has no relation whatsoever with the commit hash or revision number.

I don't know about the location in the middle of line next to the hash. 
How about putting it first on the line, next to the graph?

It looks a bit weird when the numbers jump from 9 to 10. Please make all 
the numbers same width and right align them - perhaps by putting them in 
a separate column.


I'm not sure how much of a win I think it is ... but ok. A mouseover 
tooltip could perhaps explain what the number means - especially if the 
tip was different for the first and last changeset.

Or could we perhaps just add a line explaining "oldest at bottom, most 
recent on top" before and/or after the list instead of using vertical 
space on every line?

/Mads



>
> diff --git a/kallithea/public/css/style.css b/kallithea/public/css/style.css
> --- a/kallithea/public/css/style.css
> +++ b/kallithea/public/css/style.css
> @@ -2311,6 +2311,13 @@ h3.files_location {
>       margin-right: -3px;
>   }
>   
> +.changeset-logical-index {
> +    color: #666666;
> +    font-style: italic;
> +    font-size: 85%;
> +    padding-right: 0.5em;
> +}
> +
>   .changeset_hash {
>       color: #000000;
>   }
> diff --git a/kallithea/templates/compare/compare_cs.html b/kallithea/templates/compare/compare_cs.html
> --- a/kallithea/templates/compare/compare_cs.html
> +++ b/kallithea/templates/compare/compare_cs.html
> @@ -1,5 +1,6 @@
>   ## Changesets table !
>   <div class="container">
> +  <% num_cs = len(c.cs_ranges) %>
>     %if not c.cs_ranges:
>       <span class="empty_data">${_('No changesets')}</span>
>     %else:
> @@ -39,7 +40,7 @@
>           <td style="width: 140px"><span class="tooltip" title="${h.tooltip(h.age(cs.date))}">${cs.date}</span></td>
>           <td><div class="gravatar" commit_id="${cs.raw_id}">${h.gravatar(h.email_or_none(cs.author), size=14)}</div></td>
>           <td><div class="author">${h.person(cs.author)}</div></td>
> -        <td>${h.link_to(h.show_id(cs),h.url('changeset_home',repo_name=c.cs_repo.repo_name,revision=cs.raw_id))}</td>
> +        <td><span class="changeset-logical-index">${num_cs - cnt}</span> ${h.link_to(h.show_id(cs),h.url('changeset_home',repo_name=c.cs_repo.repo_name,revision=cs.raw_id))}</td>
>           <td>
>           %if cs.branch:
>           <span class="branchtag">${h.link_to(cs.branch,h.url('changelog_home',repo_name=c.cs_repo.repo_name,branch=cs.branch))}</span>



More information about the kallithea-general mailing list