generate clone without copying any source
Matt Mackall
mpm at selenic.com
Fri Sep 12 00:21:13 UTC 2008
On Thu, 2008-09-11 at 17:00 -0400, Bill Freeman wrote:
> Thomas Rowe wrote:
> > I use mercurial to manage personal branches and revisions on a very
> > large C++ project. It takes a very long time to compile, so I find
> > myself doing this:
> >
> > $ hg clone rep1 rep2_hg # All I want here is the child .hg directory.
> > $ cp -R --preserve rep1 rep2 # rep2 now has all the object files and
> > # compiler specific temporary files, so it doesn't need to be rebuilt.
> > $ mv rep2_hg/.hg rep2/
> > $ rm -rf rep2_hg
> >
> > Is there an easy way to achieve this with straight-up mercurial?
> >
> > Thanks,
> > Thomas Rowe
> > _______________________________________________
> > Mercurial mailing list
> > Mercurial at selenic.com
> > http://selenic.com/mailman/listinfo/mercurial
> >
> >
> >
> Note that the store inside .hg is linked or copied in any event, and has
> all of the file stuff.
>
> Assuming that rep2 directory doesn't already exist:
>
> $ hg init rep2
> $ cd rep2
> $ hg pull ../rep1
This won't hardlink things. Only clone (on a local disk) will do that.
> If rep2 already exists, but has no .hg subdirectory, and the init
> complains, then do the cd
> first and
> $ hg init .
>
> As far as I can tell, clone is like init, pull, update, so the stuff
> above gets rid of the update,
> and the files don't get copied to the working directory of rep2.
If you want to clone without copying files, simply clone -U.
--
Mathematics is the supreme nostalgia of our time.
More information about the Mercurial
mailing list