[Zope-CVS] CVS: Packages/zpkgtools/zpkgtools - locationmap.py:1.20
Fred L. Drake, Jr.
fred at zope.com
Fri Jun 11 16:23:17 EDT 2004
Update of /cvs-repository/Packages/zpkgtools/zpkgtools
In directory cvs.zope.org:/tmp/cvs-serv23292/zpkgtools
Modified Files:
locationmap.py
Log Message:
make sure Subversion URLs do not loose their "template-ness" when combined
with wildcarding
=== Packages/zpkgtools/zpkgtools/locationmap.py 1.19 => 1.20 ===
--- Packages/zpkgtools/zpkgtools/locationmap.py:1.19 Fri Jun 11 15:24:35 2004
+++ Packages/zpkgtools/zpkgtools/locationmap.py Fri Jun 11 16:22:46 2004
@@ -132,7 +132,8 @@
return urlparse.urlunsplit(parts)
else:
pathpart = cvsloader.RepositoryUrl(suffix)
- return parsed.join(pathpart).getUrl()
+ parsed = parsed.join(pathpart)
+ return get_template_url(parsed)
return None
def _have_wildcard(self, key):
@@ -176,18 +177,7 @@
" without a cvs: or Subversion base URL",
getattr(f, "name", "<unknown>"), lineno)
cvsurl = cvsbase.join(cvsurl)
-
- # XXX We need to distinguish between the tag being
- # unspecified at times and the tag being specified at
- # others; the Subversion URL classes get these
- # confused, because the abstract model for the URLs
- # isn't sufficient. For now, this avoids losing the
- # "templateness" of /tags/*/ in Subversion URLs.
- if (isinstance(cvsurl, svnloader.SubversionUrlBase)
- and not cvsurl.tag):
- cvsurl.tag = "*"
-
- url = cvsurl.getUrl()
+ url = get_template_url(cvsurl)
if resource in local_entries:
_logger.warn(
@@ -215,6 +205,19 @@
local_entries.add(resource)
return mapping
+
+
+def get_template_url(parsed):
+ #
+ # XXX We need to distinguish between the tag being unspecified at
+ # times and the tag being specified at others; the Subversion URL
+ # classes get these confused, because the abstract model for the
+ # URLs isn't sufficient. For now, this avoids losing the
+ # "templateness" of /tags/*/ in Subversion URLs.
+ #
+ if isinstance(parsed, svnloader.SubversionUrlBase) and not parsed.tag:
+ parsed.tag = "*"
+ return parsed.getUrl()
def fromPathOrUrl(path, mapping=None):
More information about the Zope-CVS
mailing list