RFC: A mercurial pack extension
John Mulligan
phlogistonjohn at asynchrono.us
Mon Feb 18 08:49:06 CST 2008
On Sunday 17 February 2008, Mark Williamson wrote:
> Hi John,
>
> > I recently wrote an extension and was hoping to get some feedback on it.
> > This extension is called 'pack' and creates whole-history bundles, and
> > can clone from them. It doesn't do anything that couldn't be done before
> > with some manual work, but I felt the urge to automate the process.
>
> Thank you! It's nice that it's possible to package an entire repository
> history in a bundle but a bit frustrating not to have a more brief way of
> doing this (and of unpacking / cloning it later).
Yes, I wanted to make it so easy (and obvious) that people wouldn't have the
urge to use zip/tar and just use bundles.
>
> I wonder if the developers would consider integrating this functionality
> into the hg core, rather than as an extension. The extension is a useful
> addition, of course, but I'd think it might be good to have this stuff all
> work by default. Had you considered taking that approach?
No, not really, I'm probably too chicken to go mucking around in the core at
this point. :-) What I planned on doing was seeing if folks found the
extension useful first and getting the cli "right" first.
>
> > It creates two new sub-commands 'pack' and 'unpack' which create the
> > bundle and clone from it respectively. The clone sub-command is also
> > extended to support bundle sources in the form 'bundle:<filename>' and
> > bundle+<url>. This clone operates the same as unpack with the bundle
> > prefix removed. I would especially appreciate feedback on that syntax,
> > I'm not sure if it's very mercurial-esque.
>
> I think that having the two commands isn't strictly necessary, although it
> makes life nicer when working in an extension and it makes for more
> succinct commandlines.
>
> As a user, I'd be mostly happy if I could just do something like "hg
> bundle --full <bundlename>" to create a bundle with all history in, then
> "hg clone bundle://<bundlename>" to clone from it.
That's not a bad syntax either, it gives the user an indication of what the
result will be while --base null is sort of obscure, even though it makes
sense from a technical pov.
>
> > This extension is intended to be useful to users of static web hosting,
> > ftp, IM, etc. or other situations where ssh or http are not
> > appropriate/available, and distributing an entire directory tree would be
> > inconvenient. There is a feature request/suggestion on the Mercurial wiki
> > of allowing clone from a bundle. Also, I remember some issues on the
> > mailing list with zip files and bundles were suggested but I had to hunt
> > on the wiki to figure out how to get one that had all the changesets in
> > it.
>
> I see your extension can automatically download bundles for you, which is a
> nice improvement for enabling bundles as a "clone" source. Is that just
> over HTTP or can it use any other protocols?
At this point, it's anything that python's urllib2 supports (file,http,ftp). I
don't have an ftp server so I only was able to test it with file and http. If
anyone wants to try it with ftp, that would be really great.
>
> Cheers,
> Mark
More information about the Mercurial
mailing list