Ability to download given revision as one zip file.
bos at serpentine.com
Fri Aug 19 09:40:15 CDT 2005
On Fri, 2005-08-19 at 05:36 +0200, Wojciech Miłkowski wrote:
> I implemented ability
> to download given revision of tree via hgweb as zip file.
That's great! I have a few suggestions:
The name of the zip file you generate is currently just a hash, I think.
It would be more useful if the name was constructed with a prefix that
was either pulled from the hgrc file, or if there's nothing in the hgrc
file, the basename of the repo root. I'd also suggest using the
revision number in addition to the hash, so you have a little hope of
being able to sort zip files meaningfully. That way, instead of
"b62d1e738fa9.zip", you'd get "mercurial-970-b62d1e738fa9.zip".
It's standard practice for the contents of a zip file or tarball to have
a single top-level directory, usually with the same name as the basename
of the archive file, that contains the real contents of the archive.
This prevents people from unpacking unknown stuff into the current
directory, and is a huge help.
So a file called mercurial-970-b62d1e738fa9.zip would contain a
directory named mercurial-970-b62d1e738fa9, and all of the real files
and directories would be in there. This is a life-saver.
Finally, it would be useful if the zip files were kept in a fixed-size
LRU cache directory somewhere. That way, you could check for the
existence of a pre-built zip file and serve it if you find it. Which
could save on CPU usage.
And finally finally, most Unix users are used to tarballs rather than
zip files. I know that would require calling out to an external
program, but it would be useful nonetheless.
More information about the Mercurial