monotone-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Monotone-devel] mtn:// URIs


From: Richard Levitte
Subject: Re: [Monotone-devel] mtn:// URIs
Date: Mon, 30 Aug 2010 10:09:09 +0200 (CEST)

Another way to handle it is to expand the pattern early into an array
of strings using globish and teaching monotone to handle that.

Cheers,
Richard

In message <address@hidden> on Sun, 29 Aug 2010 11:47:02 -0500, Timothy 
Brownawell <address@hidden> said:

tbrownaw> Short version: I'd like to use ';' as a URI argument separator, and
tbrownaw> error out if both a query parameter and a separate include pattern are
tbrownaw> given. Are there any objections to this?
tbrownaw> 
tbrownaw> 
tbrownaw> > $ mtn sy
tbrownaw> > 
mtn://mtn-host.prjek.net/webohst?'net.venge.monotone.{viewmtn,contrib.{webhost,usher}}*'
tbrownaw> > mtn: misuse: invalid pattern 'net.venge.monotone.{viewmtn': 
unmatched
tbrownaw> > '{'
tbrownaw> 
tbrownaw> Using ',' as a URI argument separator conflicts with braces in
tbrownaw> globishes. This could be worked around by making the URI parser ignore
tbrownaw> ',' if it's inside braces, but that's kind of icky. I'd prefer to use
tbrownaw> something like ';' as a URI separator instead. Sure it requires
tbrownaw> quoting, but you'll probably need to quote your URIs anyway...
tbrownaw> 
tbrownaw> > $ echo
tbrownaw> > 
mtn://mtn-host.prjek.net/webohst?net.venge.monotone.{viewmtn,contrib.{webhost,usher}}*
tbrownaw> > mtn://mtn-host.prjek.net/webohst?net.venge.monotone.viewmtn*
tbrownaw> > mtn://mtn-host.prjek.net/webohst?net.venge.monotone.contrib.webhost*
tbrownaw> > mtn://mtn-host.prjek.net/webohst?net.venge.monotone.contrib.usher*
tbrownaw> 
tbrownaw> If you have globishes with braces and *don't* quote them, the shell
tbrownaw> will expand them. This was OK with separate include patterns, but it
tbrownaw> does bad things if the globish is a URI parameter (and would be bad in
tbrownaw> a separate *exclude* option as well)...
tbrownaw> 
tbrownaw> > $ mtn sy
tbrownaw> > 
mtn://mtn-host.prjek.net/webhost?net.venge.monotone.{viewmtn,contrib.{webhost,usher}}*
tbrownaw> 
tbrownaw> > $ mtn ls vars
tbrownaw> > known-servers: mtn://mtn-host.prjek.net/webhost
tbrownaw> > a52f85615cb2445989f525bf17a603250381a751
tbrownaw> > server-exclude: mtn://mtn-host.prjek.net/webhost
tbrownaw> > server-include: mtn://mtn-host.prjek.net/webhost
tbrownaw> > 
{mtn://mtn\-host.prjek.net/webhost?net.venge.monotone.contrib.webhost*,mtn://mtn\-host.prjek.net/webhost?net.venge.monotone.contrib.usher*}
tbrownaw> 
tbrownaw> The entire URI gets turned into multiple arguments that each look like
tbrownaw> a URI. Then the query parameters on the first copy get ignored by mtn
tbrownaw> (when you give what it thinks are separate include parameters, it uses
tbrownaw> those exclusively), and you end up with an include pattern where all
tbrownaw> alternatives start with "mtn://...".
tbrownaw> 
tbrownaw> This could be solved with some fragile magic to collapse the multiple
tbrownaw> arguments back to one, or by erroring out if you have both a query
tbrownaw> parameter and separate include patterns (I prefer this option), or by
tbrownaw> erroring out if a separate include pattern looks like a URI.
tbrownaw> 
tbrownaw> -- 
tbrownaw> Timothy

-- 
Richard Levitte                         address@hidden
                                        http://richard.levitte.org/

"Life is a tremendous celebration - and I'm invited!"
-- from a friend's blog, translated from Swedish



reply via email to

[Prev in Thread] Current Thread [Next in Thread]