Strategies for push/merge problem?

Giorgos Keramidas keramida at ceid.upatras.gr
Tue Jul 22 20:39:08 CDT 2008


On Tue, 22 Jul 2008 20:56:38 -0400, Douglas Philips <dgou at mac.com> wrote:
>On or about 2008 Jul 22, at 8:43 PM, Giorgos Keramidas indited:
>>On Tue, 22 Jul 2008 17:18:55 -0400, Doug Philips <dgou at mac.com> wrote:
>>> My question is, how well does Mercurial cope with lots of branch
>>> names?
>
> ... non-branch-name text elided...
>
>>> Medium-esque changes (5+ changesets) often last many days or weeks
>>> before being remerged. But lets say I have 1,000 of them over the
>>> course of several years of development, will that cause performance
>>> issues with 'hg log' or any of the other commands? I can't seem to
>>> figure out when in the wiki or book or man pages to go for that
>>> answer...
>>
>> It probably makes a LOT sense to merge more often than `once every
>> 1000 changesets'.
>
> Sorry, I was too terse.
> My understanding is that "branch names live forever".
>
> So after a few years, you might have many hundreds or low-thousands of
> medium-long branch names for branches that were merge after, say 5-30+
> changesets. Most of those will be inactive branches, but since the
> names never die, they're still in the repo, right?
>
> My question is what is the performance impact of that, and what about
> the interface. hg branches prints 3 pages of text, etc. :)

Ah, now I got you...  I should know that responding to email minutes
after waking up is usually a slightly bad idea :)

I haven't experimented with thousands of open named branches.

Normal 'every day' commands don't really do a *lot* of stuff to parse
the entire branch list.  For instance, "hg log" displays the branch of a
changeset after doing:

    for st, rev, fns in changeiter:
        [...]
        revbranch = get(rev)[5]['branch']

This should be pretty fast, because it doesn't iterate over the entire
branch name space.

The only commands that I would expect to be slightly slower are:

    hg branch "name"
    hg branches

because they call repo.branchtags().  There's the branch cache which may
help a lot with that, so things look nice, but running actual *tests*
with a few thousands branches may be worth doing anyway :-)



More information about the Mercurial mailing list