[Buildbot-devel] Mercurial rev-ids 12 -> 40 char + jQuery

Marcus Lindblom macke at yar.nu
Sun Jan 17 17:44:00 UTC 2010


On 2010-01-17 06:48, Dustin J. Mitchell wrote:
> On Fri, Jan 15, 2010 at 1:44 AM, Marcus Lindblom<macke at yar.nu>  wrote:
>> That was my plan. :)
>>
>> Although I'd like to be able to select&  copy the full rev id to the
>> clipboard. Haven't thought of a good way to do that yet.
>
> It would be cool if all of the SourceStamp could define a "short"
> revision identifier for use on the web (and in other status plugins, I
> suppose).  I know darcs revisions are ridiculously long, though I'm
> not sure how to shorten them.

Cool, but requires messing to much with every VC more or less. (And then 
I'd want to have Mercurial's numeric ids too, which aren't a 
short-version, but rather a repo-specific id that's sometimes useful.)

I'll make a filter for the revision id that shows a shortened version 
(12 chars) by default, but include the full rev in the HTML for future 
improvements. I suppose it could be improved to extract info from a 
SourceStamp instance, once it's there.

The plan is to write some javascript that shows the full revision on 
mouse-over. (This could allows to have a button somewhere on the page 
that swaps between short and long ids.)

For that, I'm planning to bring in jQuery, since writing plain 
javascript is a PITA.

Given that, I'll really have to look at getting cache control headers 
(expires, etc) in there. There was talk about a 'media' directory to go 
with the templates, and that is still a good idea. I just haven't 
figured out how to apply that best. In the meantime, setting an 
expire-time of 1 hour on everything served statically by BB is probably 
a good compromise.

Note that w/o javascript, thing will still work, you just have to click 
to the build to see the full rev-id. (or change the css..)

Cheers,
/Marcus





More information about the devel mailing list