Things I Learned From Writing a Mercurial Extension

I wrote my first mercurial extension today. It will print a log of all the commits you need to get from a changeset A which used to be the only head of a repository to a changeset B which is now the only head of the repository.It’s part of a project to get our buildbots hooked up to mercurial in a sane way. I need to make the same logic available via HTTP. It wasn’t too hard, but there are some tricky/undocumented things in the mercurial API that made life difficult.

Atom Feed for Comments 3 Responses to “Things I Learned From Writing a Mercurial Extension”

  1. shirish Says:

    Hi there,
    Does this have to do anything with the fact that Mozilla is/was thinking to move to a dvcs. I found your post on the mozilla planet hence asked :)

  2. Benjamin Smedberg Says:

    Mozilla is actively using Mercurial already for mozilla2, though 1.9 development is still taking place in CVS.

  3. mpm Says:

    Quoting wire protocol:

    for tip, base in list:
    walk back a linear branch, return elements 1, 2, 4, 8..
    (and this lets us do bisection search if we diverge in the middle of one of these long branches)

    Note the “1, 2, 4, 8”.

    One of the biggest open problems is how to reduce the number of round trips the wire protocol does to O(1) while not increasing the transferred data outrageously. If we have a million changesets, we don’t want in/out/push/pull to have to transfer even a bit per changeset to figure out that we have all but 10 locally.

Leave a Reply