[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Monotone-devel] mtn:// URIs
From: |
Timothy Brownawell |
Subject: |
[Monotone-devel] mtn:// URIs |
Date: |
Sun, 29 Aug 2010 11:47:02 -0500 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.4) Gecko/20100718 Icedove/3.1 |
Short version: I'd like to use ';' as a URI argument separator, and
error out if both a query parameter and a separate include pattern are
given. Are there any objections to this?
$ mtn sy
mtn://mtn-host.prjek.net/webohst?'net.venge.monotone.{viewmtn,contrib.{webhost,usher}}*'
mtn: misuse: invalid pattern 'net.venge.monotone.{viewmtn': unmatched '{'
Using ',' as a URI argument separator conflicts with braces in
globishes. This could be worked around by making the URI parser ignore
',' if it's inside braces, but that's kind of icky. I'd prefer to use
something like ';' as a URI separator instead. Sure it requires quoting,
but you'll probably need to quote your URIs anyway...
$ echo
mtn://mtn-host.prjek.net/webohst?net.venge.monotone.{viewmtn,contrib.{webhost,usher}}*
mtn://mtn-host.prjek.net/webohst?net.venge.monotone.viewmtn*
mtn://mtn-host.prjek.net/webohst?net.venge.monotone.contrib.webhost*
mtn://mtn-host.prjek.net/webohst?net.venge.monotone.contrib.usher*
If you have globishes with braces and *don't* quote them, the shell will
expand them. This was OK with separate include patterns, but it does bad
things if the globish is a URI parameter (and would be bad in a separate
*exclude* option as well)...
$ mtn sy
mtn://mtn-host.prjek.net/webhost?net.venge.monotone.{viewmtn,contrib.{webhost,usher}}*
$ mtn ls vars
known-servers: mtn://mtn-host.prjek.net/webhost
a52f85615cb2445989f525bf17a603250381a751
server-exclude: mtn://mtn-host.prjek.net/webhost
server-include: mtn://mtn-host.prjek.net/webhost
{mtn://mtn\-host.prjek.net/webhost?net.venge.monotone.contrib.webhost*,mtn://mtn\-host.prjek.net/webhost?net.venge.monotone.contrib.usher*}
The entire URI gets turned into multiple arguments that each look like a
URI. Then the query parameters on the first copy get ignored by mtn
(when you give what it thinks are separate include parameters, it uses
those exclusively), and you end up with an include pattern where all
alternatives start with "mtn://...".
This could be solved with some fragile magic to collapse the multiple
arguments back to one, or by erroring out if you have both a query
parameter and separate include patterns (I prefer this option), or by
erroring out if a separate include pattern looks like a URI.
--
Timothy
Free public monotone hosting: http://mtn-host.prjek.net
- [Monotone-devel] mtn:// URIs,
Timothy Brownawell <=