beginner question: networkless use of hg

Giorgos Keramidas keramida at ceid.upatras.gr
Tue May 20 02:57:57 UTC 2008


On Mon, 19 May 2008 11:22:22 -0400, Darrell Karbott <dkarbott at comcast.net> wrote:
> Is it possible for developers without any network connection at all to
> collaborate using hg?  From what I can see in the docs it seems like
> you should be able to exchange changes (e.g. by USB key or some other
> means) using bundles, but then it seems like merging gets kind of
> tricky.

It shouldn't be any trickier than directly pulling stuff from a network
based clone.  Bundles preserve the history of the changes they embed, so
you can always use an `integration workspace' as in:

    cd /var/tmp/keramida

    hg clone ~/work/project-1.0

    cd project-1.0

    hg pull /var/tmp/keramida/bundle-from-darrell.hg

Then you can attempt a merge as many times as necessary.  When you are
done merging, and you commit the merge into the integration workspace at
`/var/tmp/keramida/project-1.0' you can pull the changes into your
normal workspace:

    cd ~/work/project-1.0

    hg pull /var/tmp/keramida/project-1.0

> Is there a howto somewhere on best practices for networkless use of hg?

My experience so far with pulls from `other' trees seems to indicate
that it's a good idea to use a separate `integration workspace', as I
described above.  This way if you botch the integration, you can simply
wipe the integration workspace and start from scratch.

The other option, of pulling from a bundle directly into a personal
workspace is a bit risky.  You may accidentally pull hundreds or even
thousands of changesets with a *very* complex history graph into an
otherwise `clean' workspace and then decide that this was a mistake.
Cleaning up is still possible, but it's far trickier than a simple

    rm -fr /var/tmp/integration-workspace

> Also is there any way I can explicitly keep hg from trying to contact
> remote machines?

<half-jokingly>
Bring down all the network interfaces?  That's bound to work :)
</half-jokingly>




More information about the Mercurial mailing list