mercurial "flat checkout / update"

Greg Ward greg-hg at gerg.ca
Sun Feb 14 21:43:21 UTC 2010


On Sat, Feb 13, 2010 at 1:53 PM, rupert THURNER
<rupert.thurner at gmail.com> wrote:
> yes, but for using push/pull we need to clone the repository, which we
> wanted to avoid in a software distribution environment. what we intended to
> have:
>
> 1. a slim client to update the software, e.g. mercurial
> 2. which can be used to update a directory to a given revision
> 3. as this directory is big (~1GB) and contains binaries, and no
>     push/change from the client to the server is neither necessary nor
>     desired we wanted to avoid having a cloned repository
>
> i know that one can export a whole revision without getting the .hg. but i
> am unaware of something which stores the current revision and only delivers
> the changed files between the current and the desired revision.

If you know what changeset the client has (e.g. from
.hg_archival.txt), and you're willing to write a little server-side
code, I think this is doable.  Here's the idea: client has changeset A
and wants changeset B (where B might be an abstraction like "the
latest head of branch 1.2").  So client passes (A, B) to the server.
Server does the equivalent of

  hg status --rev A:B

and passes back to the client two things: an archive of added/modified
files that the client will unpack, and a list of removed files for the
client to remove.

If you can assume your client has patch, you can do it even more
efficiently by simply having the server pass the output of

  hg diff -r A:B

back to the client, which then applies the patch.  Oh yeah, server
also has to pass back the exact changeset id for B, so the client has
it for the next time this happens.

Greg



More information about the Mercurial mailing list