The View from the Moon

20070412 Thursday April 12, 2007

Some work on libMicro; Mercurial transition notes

I decided to help out Bart and Phil by opening the libMicro project. The source for libMicro has been open for a while (hosted in the performance community), and internally, Bart kept it in a Teamware workspace.  But now we've got it officially ensconced in a project of its own, and the source has been moved into a Mercurial repository. As a result, you can now browse the source online!  I've also been attempting to make some improvements to it which you can also examine.  Here are some notes which might be useful to other folks making similar Teamware-to-Mercurial transitions:

  • There are some good directions here for setting up a repository.
  • You'll want to set up a personal ~/.hgrc file because you probably want to associate your email address with your putbacks.  (So that you can be e.g. Joe.Smith@sun.com and not joe@mymachine.eng.sun.com. See hgrc(5). Note that if you've set your repository to send notifications to a list (like xyz-discuss@opensolaris.org) this is especially important. I set the from= and username= directives.
  • You should set up an hgignore(5) file for your repository.  The idea is to tell Mercurial which files it should definitely not care about.  Things like .o files and generated binaries.  .hgignore is just another file which you can check into your repository and version control.
  • You may wish to go through your source files and remove and SCCS detritus (like #pragma ident directives) since Mercurial doesn't use these.

Kudos go to the OpenSolaris infrastructure team: The Mercurial infrastructure just works (perhaps with the exception of the email caveat I mention above).  That said, there are a couple of minor improvements I'd like to see:

  • A link from the project page listing the repositories, including: committers, repository URIs, links to the source browser, etc.
  • In the administration GUI, the repository URIs  are not displayed, and should be.
  • A way to display recent commits on the project page.
All in all, I've had a very positive experience with this new set of tools.  I think the trajectory here looks very, very promising.

(2007-04-12 19:02:25.0) Permalink Comments [5]
Trackback: http://blogs.sun.com/dp/entry/some_work_on_libmicro
 

Comments:

"A way to display recent commits on the project page."

The internal Web server of a Mercurial http://-enabled repository includes support for an RSS feed of the recent putbacks. For instance, my own mercurial repos at http://hg.hellug.gr/ display this RSS link by the right side of the repository list.

Given a web interface for repository "foo" at "http://hg.opensolaris.org/project/foo" it should be trivial to build a "recent commits" sidebar box on any web page, by pulling the RSS feed of the commits from "http://hg.opensolaris.org/project/foo/rss-log" :-)

Posted by Giorgos Keramidas on April 13, 2007 at 01:29 AM PDT #

Hello,

may I suggest the following?

/^\!/ \
{
split($0, A_header, ":");
name = substr(A_header[1],2);
headers[name]=name;
header_data[name,FILENAME] = substr($0, length(name) + 3);
if (header_names[name] == 0)
{
header_names[name] = ++header_count;
headers[header_count] = name;
}
}
! /^[#\!]|errors/ \
{
if(NF >= 7)
{
if (benchmark_names[$1] == 0)
{
benchmark_names[$1] = ++benchmark_count;
benchmarks[benchmark_count] = $1;
}
if ($6 == 0)
{
benchmark_data[$1,FILENAME] = $4;
}
else
{
benchmark_data[$1,FILENAME] = -1;
}
}
}

END \
{
...
}

Indentation will most likely be lost... sorry...

Posted by UX-admin on April 13, 2007 at 02:52 AM PDT #

UX_Admin-- If you could send me the diffs in email, that would be great. You didn't even indicate which file you're modifying, or what this does.

Posted by Dan Price on April 13, 2007 at 11:40 AM PDT #

Giorgios: You're right, but I don't think we're running http-enabled for each repository. I don't really know the rationale for that.

Posted by Dan Price on April 13, 2007 at 11:42 AM PDT #

Ah :-/

I think RSS commit logs are a feature of the http-based repo access methods. I'll investigate a bit more and see if I can make it work over SSH too. I already know that the onnv-gate and onnv-scm repos of OpenSolaris are already set up to work through anonymous SSH, so something like an RSS-feed over SSH for the last 10 commits would be nice to have.

Posted by keramida on April 13, 2007 at 11:56 AM PDT #

Post a Comment:

Comments are closed for this entry.
Dan Price's Weblog
[about me]