Clonning only from version and diff before pulls

Andrew Thompson andrewkt at aktzero.com
Wed Aug 17 09:20:01 CDT 2005


Quoting Daniel Santa Cruz <byteshack at gmail.com>:
> I have a repository called "upstream" which does just that.  There are
> no local changes ever made to that repo.

That seems to be the accepted way to work: I track the primary hg repository
with a cron job that just runs "hg update -C" in that folder. This is my
pristine copy, and I make no manual changes to it.

This makes all the rest of your diffs and other operations filesystem local
instead of happening over the network.

> "upstream" is now up to date.  I would like to make some changes to
> files in it in a new repository called "sandbox".  I go ahead and do
> an "hg clone".  But "hg clone" gets me a new repository that has all
> the revisions that were in "upstream".  I don't really care about past
> revisions.  What would be the correct way of doing this?  I would
> definately like to trac changes on "sandbox" until they are ready for
> commit, but having a fullblown copy of the "upstream" repo seems like
> a total waste.

One of the features of Hg is cloning by hardlinking. If your upstream 
is on the
same filesystem as your working copy, you only use space for your actual
current working copy, and the .hg/ files that have been changed by local
commits.

> I keep "sandox" sync'ed with "upstream" by periodically making sure
> that I'm not straying too far away from it.  Is there a way for me to
> see what I would be pulling (doing a diff) before I actually do the
> pull?  This would allow me some control over what gets put into my
> "sanbox" repository.

It's been said to "merge often" to keep your working copy close to the
"upstream" version.

Clone your sandbox. Pull from your upstream(pristine) copy and attempt 
a merge.*
If you like the results blow away your old sandbox and continue on.

*I'm kind of fuzzy on merges, other users may describe this step better than I
have.

> It's fun to see how Hg is moving right along!  Great work!
> Daniel

----
Andrew Thompson
http://aktzero.com/



More information about the Mercurial mailing list