[PATCH V2] hgweb: teach archive how to handle file patterns
mpm at selenic.com
Fri Feb 8 08:10:16 CST 2013
On Fri, 2013-02-08 at 14:01 +0000, Angel Ezquerra wrote:
> On Fri, Feb 8, 2013 at 1:58 PM, Mads Kiilerich <mads at kiilerich.com> wrote:
> > On 02/08/2013 02:48 PM, Angel Ezquerra wrote:
> >> # HG changeset patch
> >> # User Angel Ezquerra <angel.ezquerra at gmail.com>
> >> # Date 1360141605 -3600
> >> # Node ID 766ad3e48bdff8ee2b2a3a9276eff398dcaafa02
> >> # Parent 1516d5624a2911fcb90ee051c6dc0679b49aef55
> >> hgweb: teach archive how to handle file patterns
> >> The archive web command now takes into account the "file" request entry,
> >> if one
> >> is provided.
> >> The provided "file" is processed as a "path" pattern by default, which
> >> makes it
> >> easy to only archive a certain file or directory. However, it is possible
> >> to
> >> specify a different type of pattern, such as relglob by specifying it
> >> explicitly on the query URL.
> >> With this change hgweb can to process requests such as:
> >> 1. http://mercurial.selenic.com/hg/tip.zip/mercurial/templates
> >> This will download all files on the mercurial/templates directory as
> >> a zip
> >> file
> >> 2. http://mercurial.selenic.com/hg/tip.tar.gz/relglob:*.py
> > I think this will be the first time we expose patterns - and thus regexps -
> > in hgweb. I'm not sure we want to do that before we have some way of
> > processing regexps 'safely'.
By safely, I assume you mean "won't use exponential time because of
backtracking" or do you have something else in mind? Filesets can also
be very expensive.
> Would it be ok if for now we limit the "patterns" that can be used
> this way to glob, relglob, path and relpath?
We probably want a function or class that decides whether a pattern is
"safe", starting with very conservative assumptions.
Mathematics is the supreme nostalgia of our time.
More information about the Mercurial-devel