Bug 3626 - hgweb graph has incorrect padding for branches other than the first
Summary: hgweb graph has incorrect padding for branches other than the first
Status: RESOLVED FIXED
Alias: None
Product: Mercurial
Classification: Unclassified
Component: hgweb (show other bugs)
Version: earlier
Hardware: PC Windows
: normal bug
Assignee: Tim Delaney
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-16 21:05 UTC by Tim Delaney
Modified: 2017-11-01 18:04 UTC (History)
4 users (show)

See Also:
Python Version: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tim Delaney 2012-09-16 21:05 UTC
When you have more than one branch displayed in the graph, the description, etc gets pushed further and further from the graph the more branches there are. This appears to be what is described in http://bz.selenic.com/show_bug.cgi?id=2683 but that has been marked as resolved with a fix that doesn't address the issue described (though does fix another issue).

The cause is an incorrect padding-left calculation.

Currently the padding is calculated as

    var left = (this.columns + 1) * this.bg_height.

The correct calculation is:

    var colwidth = this.box_size - 1;
    var left = (this.bg_height - colwidth) + (this.columns + 1) * colwidth;
Comment 1 Tim Delaney 2012-09-16 21:08 UTC
Fix available at: https://bitbucket.org/magao/mercurial-hgweb-issue3626
Comment 2 Tim Delaney 2012-09-16 21:31 UTC
Oops - should have linked to the changeset:

https://bitbucket.org/magao/mercurial-hgweb-issue3626/changeset/c1e4c92d04ec10666bb9801379c8938ecb996b2e
Comment 3 Tim Delaney 2012-09-16 21:38 UTC
Oops - still had an off-by-one error that wasn't apparent until I went to a section with a lot of branches showing. Fixed in:

https://bitbucket.org/magao/mercurial-hgweb-issue3626/changeset/1cc47aaadd9c239d90b1081cba8c53f393d85245

which also uses tabs to match the existing templates.
Comment 4 Nikolaj Sjujskij 2012-09-17 04:29 UTC
Patches are to be sent to mercurial-devel mailing list. Please read http://mercurial.selenic.com/wiki/ContributingChanges. Thank you for contribution.
Comment 5 Tim Delaney 2012-09-17 14:37 UTC
Collapsed patch posted.
Comment 6 HG Bot 2012-09-17 17:10 UTC
Fixed by http://selenic.com/repo/hg/rev/ffe3630cb243
Tim Delaney <timothy.c.delaney@gmail.com>
hgweb: fix incorrect graph padding calculation (issue3626)

hgweb has an incorrect padding calculation, causing the text to move further
away from the graph the more branches there are (issue3626). This patch fixes
all existing templates (gitweb, monoblue, paper and spartan).

Tests updated by Patrick Mezard <patrick@mezard.eu>

(please test the fix)