two repositories sharing the same store?

Alpár Jüttner alpar at cs.elte.hu
Tue Jul 29 14:22:10 CDT 2008


On Tue, 2008-07-29 at 11:59 -0700, Kelly O'Hair wrote:
> The way Mercurial shares files with hardlinks between related repositories
> is fantastic, it's completely invisible to the users of the repositories.
> No argument that this sharing is a GREAT idea.

It is a great idea of saving disk space, but not for creating a true
shared repo.

> I was referring to sharing the entire .hg directory with a softlink.

Doing this is equivalent with shooting yourself in the foot, of course.

However, sharing .hg/store by _softlink_ indeed makes sense. In fact it
would be nice to have a native support for doing that.

Best regards,
Alpar


> 
> -kto
> 
> 
> Alpár Jüttner wrote:
> > On Tue, 2008-07-29 at 08:37 -0700, Kelly O'Hair wrote:
> >> Well, just for the email record, I think having two repositories share the
> >> same .hg directory is a really really really BAD idea.
> > 
> > But having two repositories that share the same .hg/store is NOT so bad
> > idea.
> > 
> > Regards,
> > Alpar
> > 
> >> -kto
> >>
> >> Sean Russell wrote:
> >>> On Monday 28 July 2008 04:17:27 pm Alpár Jüttner wrote:
> >>>>> As you add changesets to the clones and push/pull them back and forth,
> >>>>> the .hg repositories will begin to contain duplicates which are not
> >>>>> hardlinked.
> >>>> Well, it is not my question, but the first (and probably more important)
> >>>> part of the question is about how to synchronize the repos automatically
> >>>> (without explicitly pushing the changesets).
> >>> I don't think you can *officially* have two workspaces automatically reflect 
> >>> each other.  There will always be a pull/merge series of steps there if you 
> >>> use pure Mercurial-isms.
> >>>
> >>> What you want is two different workspaces to share the same .hg directory.  
> >>> You could try *not* cloning, but symlinking the .hg directory (and any 
> >>> related .hg* files):
> >>>
> >>> 	# Working dir 1 is project1:
> >>> 	cp -pvr project1 project2
> >>> 	cd project2
> >>> 	rm -rf .hg*
> >>> 	ln -s ../project1/.hg .hg
> >>>
> >>> That might get you to where you want to be.
> >>>
> >>> --- SER
> >>>
> >>> _______________________________________________
> >>> Mercurial mailing list
> >>> Mercurial at selenic.com
> >>> http://selenic.com/mailman/listinfo/mercurial
> >> _______________________________________________
> >> Mercurial mailing list
> >> Mercurial at selenic.com
> >> http://selenic.com/mailman/listinfo/mercurial
> > 




More information about the Mercurial mailing list