Switch between branches (repos behaving as branches)

Greg Ward greg-hg at gerg.ca
Thu Jun 17 07:37:22 CDT 2010


2010/6/17 Rafael Fernández López <ereslibre at kde.org>:
>>
>> Have you heard of ccache?
>>
>> http://www.google.com/search?q=ccache
>
> Yep, used it in my gentoo user phase ;)
>
> That's not the issue actually. If you have two repositories (one as
> main, the other as a branch for testing an experimental feature) it is
> not possible to share this build infos as far as I know. They are in
> different folders, and also you would have to bother of creating
> another project for your IDE that points to the experimental branch.
>
> If I am missing something about ccache, please clarify ;)

I've never used ccache.  I just saw "C++" and "build times" and
thought maybe you didn't know about it.  My bad.

I went back and actually read your post, and it sounds like you have
*sort of* reinvented the share extension, which works by sharing a
copy of .hg/store between multiple working dirs.  Sharing .hg rather
than .hg/store has some advantages:
  * branch head cache is shared
  * tag cache is shared
  * MQ directory (if any) is shared
  * attic directory (if any) is shared

And it has some disadvantages:
  * MQ directory (if any) is shared
  * attic directory (if any) is shared
  * bisect state is shared
  * transplant state is shared

Whether shared MQ/attic directories is a good thing or a bad thing
depends on how you use MQ/attic.

Take a look at http://mercurial.selenic.com/wiki/ShareExtension.  Even
if you stick with your scheme, you should be aware of the risks of
sharing history between working dirs, and those risks are described in
that wiki page.

Incidentally, the IDE state issue is one that has been a persistent
annoyance for us over the years at work.  Most of my co-workers use
Eclipse heavily, and things can get confusing when you have multiple
working directories all looking at slightly different trunks.  This
isn't unique to Mercurial, but the "create a create a new local clone
for new work" culture exposes weaknesses in the design of most IDEs.
(Or at least that's my suspicion.  zsh, XEmacs, and grep are all the
IDE I need, so I don't really see the point of Eclipse. But then, I
have the privilege of hacking in Python rather than Java... my
co-workers are not so lucky.)

Greg


More information about the Mercurial-devel mailing list