Changeset 171258 in webkit


Ignore:
Timestamp:
Jul 18, 2014 9:59:32 PM (10 years ago)
Author:
rniwa@webkit.org
Message:

Perf dashboard shouldn't show the full git hash
https://bugs.webkit.org/show_bug.cgi?id=135083

Reviewed by Benjamin Poulain.

Detect Git/Mercurial hash by checking the length.

If it's a hash, use the first 8 characters in the label
while retaining the full length to be used in hyperlinks.

  • public/js/helper-classes.js:

(.this.formattedRevisions):
(TestBuild):

Location:
trunk/Websites/perf.webkit.org
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Websites/perf.webkit.org/ChangeLog

    r169471 r171258  
     12014-07-18  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        Perf dashboard shouldn't show the full git hash
     4        https://bugs.webkit.org/show_bug.cgi?id=135083
     5
     6        Reviewed by Benjamin Poulain.
     7
     8        Detect Git/Mercurial hash by checking the length.
     9
     10        If it's a hash, use the first 8 characters in the label
     11        while retaining the full length to be used in hyperlinks.
     12
     13        * public/js/helper-classes.js:
     14        (.this.formattedRevisions):
     15        (TestBuild):
     16
    1172014-05-29  Ryosuke Niwa  <rniwa@webkit.org>
    218
  • trunk/Websites/perf.webkit.org/public/js/helper-classes.js

    r166995 r171258  
    8686
    8787            var revisionPrefix = '';
    88             var revisionDelimitor = '-';
     88            var revisionDelimiter = '-';
     89            var isHash = false;
    8990            if (parseInt(currentRevision) == currentRevision) { // e.g. r12345.
    9091                revisionPrefix = 'r';
     
    9293                    previousRevision = (parseInt(previousRevision) + 1);
    9394            } else if (currentRevision.indexOf(' ') >= 0) // e.g. 10.9 13C64.
    94                 revisionDelimitor = ' - ';
     95                revisionDelimiter = ' - ';
     96            else if (currentRevision.length == 40) // e.g. git hash
     97                isHash = true;
    9598
    9699            var labelForThisRepository;
    97             if (previousRevision)
    98                 labelForThisRepository = revisionPrefix + previousRevision + revisionDelimitor + revisionPrefix + currentRevision;
    99             else
    100                 labelForThisRepository = '@ ' + revisionPrefix + currentRevision;
     100            if (isHash) {
     101                formattedCurrentHash = currentRevision.substring(0, 8);
     102                if (previousRevision)
     103                    labelForThisRepository = previousRevision.substring(0, 8) + '..' + formattedCurrentHash;
     104                else
     105                    labelForThisRepository = '@ ' + formattedCurrentHash;
     106            } else {
     107                if (previousRevision)
     108                    labelForThisRepository = revisionPrefix + previousRevision + revisionDelimiter + revisionPrefix + currentRevision;
     109                else
     110                    labelForThisRepository = '@ ' + revisionPrefix + currentRevision;
     111            }
    101112
    102113            var url;
Note: See TracChangeset for help on using the changeset viewer.