[Zope-CVS] CVS: Packages/zpkgtools/zpkgtools - include.py:1.7
Fred L. Drake, Jr.
fred at zope.com
Tue Mar 30 16:37:37 EST 2004
Update of /cvs-repository/Packages/zpkgtools/zpkgtools
In directory cvs.zope.org:/tmp/cvs-serv6244
Modified Files:
include.py
Log Message:
remove more cruft; getLoader() called the CvsLoader constructor in correctly,
and not all the magic that was being done has proved helpful
=== Packages/zpkgtools/zpkgtools/include.py 1.6 => 1.7 ===
--- Packages/zpkgtools/zpkgtools/include.py:1.6 Tue Mar 30 10:28:08 2004
+++ Packages/zpkgtools/zpkgtools/include.py Tue Mar 30 16:37:06 2004
@@ -243,6 +243,11 @@
self.includeFromLocalTree(os.path.join(self.source, source),
destination)
else:
+ if isinstance(cvsurl, cvsloader.RepositoryUrl):
+ if self.cvsurl is None:
+ raise InclusionError(
+ "can't load repository: URL without base cvs: URL")
+ cvsurl = self.cvsurl.join(cvsurl)
self.includeFromCvs(cvsurl, destination)
def includeFromLocalTree(self, source, destination):
@@ -266,23 +271,7 @@
inf.close()
def includeFromCvs(self, cvsurl, destination):
- loader = self.getLoader(cvsurl)
- source = loader.load(cvsurl)
- self.includeFromLocalTree(source, destination)
-
- def getLoader(self, cvsurl):
- if self.cvs_loader is None and self.cvsurl is not None:
- self.cvs_loader = cvsloader.CvsLoader(self.cvsurl)
if self.cvs_loader is None:
- # We can create a temporary loader from a cvs: URL if we need to:
- if isinstance(cvsurl, cvsloader.CvsUrl):
- loader = cvsloader.CvsLoader(cvsurl)
- else:
- # We don't have a cvs: URL, and repository: URLs are
- # always relative to a cvs: URL, so we can't proceed:
- raise InclusionError(
- "cannot load URL %s without base repository information"
- % cvsurl.getUrl())
- else:
- loader = self.cvs_loader
- return loader
+ self.cvs_loader = cvsloader.CvsLoader()
+ source = self.cvs_loader.load(cvsurl.getUrl())
+ self.includeFromLocalTree(source, destination)
More information about the Zope-CVS
mailing list