[Zope-CVS] CVS: Packages/zpkgtools/zpkgtools - locationmap.py:1.17

Fred L. Drake, Jr. fred at zope.com
Thu Jun 3 23:51:02 EDT 2004


Update of /cvs-repository/Packages/zpkgtools/zpkgtools
In directory cvs.zope.org:/tmp/cvs-serv4233/zpkgtools

Modified Files:
	locationmap.py 
Log Message:
- clarify an exception message
- make sure Subversion URLs using the /tags/*/ "templating" feature
  don't lose their template-ness when making a round trip through the
  parsed URL classes
- only make a round trip through the parsed URL classes when necessary


=== Packages/zpkgtools/zpkgtools/locationmap.py 1.16 => 1.17 ===
--- Packages/zpkgtools/zpkgtools/locationmap.py:1.16	Mon May 17 15:50:07 2004
+++ Packages/zpkgtools/zpkgtools/locationmap.py	Thu Jun  3 23:50:31 2004
@@ -23,6 +23,7 @@
 
 from zpkgtools import cvsloader
 from zpkgtools import loader
+from zpkgtools import svnloader
 
 
 _logger = logging.getLogger(__name__)
@@ -142,10 +143,21 @@
                 if cvsbase is None:
                     raise MapLoadingError(
                         "repository: URLs are not supported"
-                        " without a cvs: base URL",
+                        " without a cvs: or Subversion base URL",
                         getattr(f, "name", "<unknown>"), lineno)
                 cvsurl = cvsbase.join(cvsurl)
-            url = cvsurl.getUrl()
+
+                # 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()
 
         # We only want to add it once, so that loading several
         # mappings causes the first defining a resource to "win":




More information about the Zope-CVS mailing list