Branch = copy - no central repository of branches?

Bryan O'Sullivan bos at serpentine.com
Tue Jun 20 19:58:25 CDT 2006


On Mon, 2006-06-19 at 18:06 +0100, Paul Moore wrote:

> Well, yes, I guess so. I'm confused over what benefit I'm getting over
> simply zipping up the directory and copying the zip to my FTP server,
> though...?

You could certainly do things that way.  It's just easier, and will
likely take less bandwidth (maybe not a consideration for a small set of
data), to do a push.

> If I use a USB drive, don't I need to have it available every time I
> want to commit (or at least, push to that copy, which I'd want to do
> relatively frequently, to keep it up to date)?

Yes.

> This works fine for mainline development. But if I create a new
> repository for a branch, I need a similar new repository on my USB key
> (or whatever I use). Either I stop and create both at the same time,
> or I need to remember when I sync up at the end of the day to create
> the USB copy then.

It almost sounds like the thing that would be easiest for you to do
would be to have all of your branches live in one place, then rsync
everything to your USB drive in one step before you go home.  No muss,
no fuss.  New branches get automatically created for you, and old ones
go away.  If you haven't committed changes, no problem; your uncommitted
edits will be in the working directories on the USB drive after the
rsync.

> I missed something there. Suppose I have a repo "C:\webapp" on my hard
> disk. I have a clone of that on my USB drive, called "H:\webapp". Now,
> I branch
> 
>     hg clone webapp webapp-fcgi
> 
> to try something out.
> 
> You're saying I can push the changes in C:\webapp-fcgi to H:\webapp,
> so that on my other PC I can successfully recover C:\webapp and
> C:\webapp-fcgi from the single repositioy H:\webapp on the USB drive?

That's possible, but a bit of a pain.  You can use "clone -r" to clone a
specific branch into one repository, then again to clone the other
branch into the other repository.

Really, using rsync to move stuff onto and off the USB drive sounds like
a better fit to your needs.  It's always a pain to have to commit at
some artificial point simply because you need to move to a different
computer, and using rsync lets you eliminate that externally imposed
step.

	<b



More information about the Mercurial mailing list