#6784 closed defect (fixed)
Multiple svn:externals not recognized when same host?
Reported by: | Owned by: | Christian Boos | |
---|---|---|---|
Priority: | normal | Milestone: | 0.11 |
Component: | version control | Version: | 0.11b1 |
Severity: | normal | Keywords: | |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
When I use multiple svn:externals conversions from the same host:
[svn:externals] svn://myhost.net/proj1 http://myhost.net:8080/proj1/browser/$path?rev=$rev svn://myhost.net/proj2 http://myhost.net:8080/proj2/browser/$path?rev=$rev
only the last one is recognized by Trac. In the browser, I see:
Property svn:externals set to * proj1 * proj2 at revision 21 in svn://myhost.net/proj2
where proj1 is not a link, but proj2 is.
Attachments (1)
Change History (14)
follow-up: 2 comment:1 by , 17 years ago
comment:2 by , 17 years ago
Replying to cboos:
So the syntax for that section needs to be fixed, ideas welcomed (preferably something backward compatible).
If we want to have URL as keys, maybe the easier path is to fix the RE, such as in
-
trac/trunk/trac/config.py
14 14 15 15 from ConfigParser import ConfigParser 16 16 import os 17 import re 17 18 18 19 from trac.core import ExtensionPoint, TracError 19 20 from trac.util.compat import set, sorted … … 37 38 the last modification time of the configuration file, and reparses it 38 39 when the file has changed. 39 40 """ 41 42 OPTRE = r'(?P<option>[^=\s][^=]*)\s*(?P<vi>[=])\s*(?P<value>.*)$' 43 40 44 def __init__(self, filename): 41 45 self.filename = filename 42 46 self.parser = ConfigParser() 47 self.parser.OPTCRE = re.compile(self.OPTRE) 43 48 self.parent = None 44 49 self._lastmtime = 0 45 50 self._sections = {}
although this is more a hack than a robust solution ;-(
I keep wondering why the syntax of [svn:externals] does not follow the usual key = value notation ?
follow-up: 4 comment:3 by , 17 years ago
Well, I started with key = value
:
[svn:externals] svn://myhost.net/proj2 = http://myhost.net:8080/proj2/browser/$path?rev=$rev
then I wondered why I had svn
as the key and //myhost.net/proj2 = http://myhost.net:8080/proj2/browser/$path?rev=$rev
as the value, and only then found out about this alternative ":" key/value separator.
So if we can get rid of that separator ":" and force "=" to be the only one, as your patch suggests we can, then I'm all for it.
comment:4 by , 17 years ago
Replying to cboos:
So if we can get rid of that separator ":" and force "=" to be the only one, as your patch suggests we can, then I'm all for it.
Ok, but is it a problem that "=" is a valid URL character?
follow-up: 9 comment:5 by , 17 years ago
Ah, yes of course :-(
What about:
[svn:externals] proj1 = svn://myhost.net/proj1 http://myhost.net:8080/proj1/browser/$path?rev=$rev proj2 = svn://myhost.net/proj2 http://myhost.net:8080/proj2/browser/$path?rev=$rev
The keys proj1 and proj2 could eventually be used as informative label somewhere.
comment:6 by , 17 years ago
Yes, true. In fact at first I tried to hack the code to get this to work:
[svn:externals] svn://myhost.net http://myhost.net:8080/$proj/browser/$path?rev=$rev
where $proj would get substituted for whatever project this is. But of course since I know no python I failed. One problem with the above is that then we need to strip $proj from the beginning of the path, I think. Also, this is only a solution to my particular problem, not the general problem.
Jean-Luc
follow-up: 8 comment:7 by , 17 years ago
Another idea is to enforce the space between = and keys, as in " = "? But maybe this is too prone to break.
comment:8 by , 17 years ago
Replying to jeanluc@mailaps.org:
Another idea is to enforce the space between = and keys, as in " = "? But maybe this is too prone to break.
…or just enclose in double-quotes URL's that contain = signs?
comment:9 by , 17 years ago
Replying to cboos:
What about:
[svn:externals] proj1 = svn://myhost.net/proj1 http://myhost.net:8080/proj1/browser/$path?rev=$rev proj2 = svn://myhost.net/proj2 http://myhost.net:8080/proj2/browser/$path?rev=$revThe keys proj1 and proj2 could eventually be used as informative label somewhere.
I thought about this solution as well, but it looked like a bit artifical. However it avoid patching the ConfigParser instance, so that may be a better approach.
by , 17 years ago
Attachment: | svn_externals_use_dummy_keys-r6505.diff added |
---|
Rework the [svn:externals]
syntax to avoid the key/value separator issue
follow-up: 11 comment:10 by , 17 years ago
Status: | new → assigned |
---|
attachment:svn_externals_use_dummy_keys-r6505.diff implements the proposal from comment:5.
comment:11 by , 17 years ago
Replying to cboos:
attachment:svn_externals_use_dummy_keys-r6505.diff implements the proposal from comment:5.
Works great for me! Thanks!
Jean-Luc
comment:12 by , 17 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Applied in r6579.
Thanks for having tested it!
Irk. That must be the ConfigParser overwritting the first entry by the second (':' is an alternative key/value pair delimiter).
So the syntax for that section needs to be fixed, ideas welcomed (preferably something backward compatible).