[CalendarServer-changes] [4811] CalendarServer/trunk

source_changes at macosforge.org source_changes at macosforge.org
Mon Nov 30 13:35:55 PST 2009


Revision: 4811
          http://trac.macosforge.org/projects/calendarserver/changeset/4811
Author:   glyph at apple.com
Date:     2009-11-30 13:35:54 -0800 (Mon, 30 Nov 2009)
Log Message:
-----------
Empty out the lib-patches/Twisted directory and bump the dependency to a revision which has all of those patches.

Modified Paths:
--------------
    CalendarServer/trunk/support/build.sh

Removed Paths:
-------------
    CalendarServer/trunk/lib-patches/Twisted/twisted.application.app.patch
    CalendarServer/trunk/lib-patches/Twisted/twisted.mail.imap4.patch
    CalendarServer/trunk/lib-patches/Twisted/twisted.python.filepath.patch
    CalendarServer/trunk/lib-patches/Twisted/twisted.python.util.patch
    CalendarServer/trunk/lib-patches/Twisted/twisted.runner.procmon.patch
    CalendarServer/trunk/lib-patches/Twisted/twisted.web2.auth.digest.patch
    CalendarServer/trunk/lib-patches/Twisted/twisted.web2.dav.fileop.patch
    CalendarServer/trunk/lib-patches/Twisted/twisted.web2.dav.method.report.patch
    CalendarServer/trunk/lib-patches/Twisted/twisted.web2.dav.resource.patch
    CalendarServer/trunk/lib-patches/Twisted/twisted.web2.error.patch
    CalendarServer/trunk/lib-patches/Twisted/twisted.web2.server.patch
    CalendarServer/trunk/lib-patches/Twisted/twisted.web2.static.patch

Deleted: CalendarServer/trunk/lib-patches/Twisted/twisted.application.app.patch
===================================================================
--- CalendarServer/trunk/lib-patches/Twisted/twisted.application.app.patch	2009-11-30 21:26:16 UTC (rev 4810)
+++ CalendarServer/trunk/lib-patches/Twisted/twisted.application.app.patch	2009-11-30 21:35:54 UTC (rev 4811)
@@ -1,39 +0,0 @@
-Index: twisted/application/app.py
-===================================================================
---- twisted/application/app.py	(revision 26969)
-+++ twisted/application/app.py	(working copy)
-@@ -241,7 +241,11 @@
-         @param application: The application on which to check for an
-             L{ILogObserver}.
-         """
--        observer = application.getComponent(ILogObserver, None)
-+        
-+        if application:
-+            observer = application.getComponent(ILogObserver, None)
-+        else:
-+            observer = None
- 
-         if observer is None:
-             observer = self._getLogObserver()
-@@ -408,9 +412,7 @@
-         Run the application.
-         """
-         self.preApplication()
--        self.application = self.createOrGetApplication()
- 
--
-         getLogObserverLegacy = getattr(self, 'getLogObserver', None)
-         if getLogObserverLegacy is not None:
-             warnings.warn("Specifying a log observer with getLogObserver is "
-@@ -418,8 +420,10 @@
-                           category=DeprecationWarning)
-             self.startLogging(self.getLogObserver())
-         else:
--            self.logger.start(self.application)
-+            self.logger.start(None)
- 
-+        self.application = self.createOrGetApplication()
-+
-         self.postApplication()
-         self.logger.stop()
- 

Deleted: CalendarServer/trunk/lib-patches/Twisted/twisted.mail.imap4.patch
===================================================================
--- CalendarServer/trunk/lib-patches/Twisted/twisted.mail.imap4.patch	2009-11-30 21:26:16 UTC (rev 4810)
+++ CalendarServer/trunk/lib-patches/Twisted/twisted.mail.imap4.patch	2009-11-30 21:35:54 UTC (rev 4811)
@@ -1,22 +0,0 @@
-Index: twisted/mail/imap4.py
-===================================================================
---- twisted/mail/imap4.py	(revision 26969)
-+++ twisted/mail/imap4.py	(working copy)
-@@ -333,7 +333,7 @@
- 
- 
- class Command:
--    _1_RESPONSES = ('CAPABILITY', 'FLAGS', 'LIST', 'LSUB', 'STATUS', 'SEARCH', 'NAMESPACE')
-+    _1_RESPONSES = ('CAPABILITY', 'FLAGS', 'LIST', 'LSUB', 'STATUS', 'SEARCH', 'NAMESPACE', 'BYE')
-     _2_RESPONSES = ('EXISTS', 'EXPUNGE', 'FETCH', 'RECENT')
-     _OK_RESPONSES = ('UIDVALIDITY', 'UNSEEN', 'READ-WRITE', 'READ-ONLY', 'UIDNEXT', 'PERMANENTFLAGS')
-     defer = None
-@@ -4159,7 +4159,7 @@
-         return "PLAIN"
- 
-     def challengeResponse(self, secret, chal):
--        return '%s\0%s\0' % (self.user, secret)
-+        return '\0%s\0%s' % (self.user, secret)
- 
- 
- class MailboxException(IMAP4Exception): pass

Deleted: CalendarServer/trunk/lib-patches/Twisted/twisted.python.filepath.patch
===================================================================
--- CalendarServer/trunk/lib-patches/Twisted/twisted.python.filepath.patch	2009-11-30 21:26:16 UTC (rev 4810)
+++ CalendarServer/trunk/lib-patches/Twisted/twisted.python.filepath.patch	2009-11-30 21:35:54 UTC (rev 4811)
@@ -1,91 +0,0 @@
-Index: twisted/python/filepath.py
-===================================================================
---- twisted/python/filepath.py	(revision 26969)
-+++ twisted/python/filepath.py	(working copy)
-@@ -326,9 +326,11 @@
-     statinfo = None
-     path = None
- 
--    def __init__(self, path, alwaysCreate=False):
-+    def __init__(self, path, alwaysCreate=False, existsCached=None, isDirCached=None):
-         self.path = abspath(path)
-         self.alwaysCreate = alwaysCreate
-+        self.existsCached = existsCached
-+        self.isDirCached = isDirCached
- 
-     def __getstate__(self):
-         d = self.__dict__.copy()
-@@ -449,6 +451,11 @@
- 
-     # stat methods below
- 
-+    def changed(self):
-+        self.statinfo = None
-+        self.existsCached = None
-+        self.isDirCached = None
-+
-     def restat(self, reraise=True):
-         """
-         Re-calculate cached effects of 'stat'.  To refresh information on this path
-@@ -460,12 +467,23 @@
-         """
-         try:
-             self.statinfo = stat(self.path)
-+            self.existsCached = True
-+            self.isDirCached = S_ISDIR(self.statinfo.st_mode)
-         except OSError:
-             self.statinfo = 0
-+            self.existsCached = False
-+            self.isDirCached = None
-             if reraise:
-                 raise
- 
-+    def getstatinfo(self):
-+        st = self.statinfo
-+        if not st:
-+            self.restat()
-+            st = self.statinfo
-+        return st
- 
-+
-     def chmod(self, mode):
-         """
-         Changes the permissions on self, if possible.  Propagates errors from
-@@ -536,7 +554,9 @@
-             C{False} in the other cases.
-         @rtype: C{bool}
-         """
--        if self.statinfo:
-+        if self.existsCached is not None:
-+            return self.existsCached
-+        elif self.statinfo:
-             return True
-         else:
-             self.restat(False)
-@@ -547,6 +567,8 @@
- 
- 
-     def isdir(self):
-+        if self.isDirCached is not None:
-+            return self.isDirCached
-         st = self.statinfo
-         if not st:
-             self.restat(False)
-@@ -603,7 +625,7 @@
-             os.rmdir(self.path)
-         else:
-             os.remove(self.path)
--        self.restat(False)
-+        self.changed()
- 
- 
-     def makedirs(self):
-@@ -770,7 +792,7 @@
-         """
-         try:
-             os.rename(self.path, destination.path)
--            self.restat(False)
-+            self.changed()
-         except OSError, ose:
-             if ose.errno == errno.EXDEV:
-                 # man 2 rename, ubuntu linux 5.10 "breezy":

Deleted: CalendarServer/trunk/lib-patches/Twisted/twisted.python.util.patch
===================================================================
--- CalendarServer/trunk/lib-patches/Twisted/twisted.python.util.patch	2009-11-30 21:26:16 UTC (rev 4810)
+++ CalendarServer/trunk/lib-patches/Twisted/twisted.python.util.patch	2009-11-30 21:35:54 UTC (rev 4811)
@@ -1,35 +0,0 @@
-Index: twisted/python/util.py
-===================================================================
---- twisted/python/util.py	(revision 26969)
-+++ twisted/python/util.py	(working copy)
-@@ -569,9 +569,29 @@
-     L2.sort()
-     return [e[2] for e in L2]
- 
--if pwd is None or grp is None or setgroups is None or getgroups is None:
-+
-+try:
-+    from ctypes import c_int, c_char_p, cdll
-+    from ctypes.util import find_library
-+    hasCtypes = True
-+except ImportError:
-+    hasCtypes = False
-+
-+if sys.platform == "darwin" and hasCtypes:
-+    import pwd
-+    libc = cdll.LoadLibrary(find_library("libc"))
-     def initgroups(uid, primaryGid):
-         """
-+        Call initgroups with ctypes.
-+        """
-+        c_gid = c_int(primaryGid)
-+        username = pwd.getpwuid(uid)[0]
-+        c_username = c_char_p(username)
-+        return libc.initgroups(c_username, c_gid)
-+
-+elif pwd is None or grp is None or setgroups is None or getgroups is None:
-+    def initgroups(uid, primaryGid):
-+        """
-         Do nothing.
- 
-         Underlying platform support require to manipulate groups is missing.

Deleted: CalendarServer/trunk/lib-patches/Twisted/twisted.runner.procmon.patch
===================================================================
--- CalendarServer/trunk/lib-patches/Twisted/twisted.runner.procmon.patch	2009-11-30 21:26:16 UTC (rev 4810)
+++ CalendarServer/trunk/lib-patches/Twisted/twisted.runner.procmon.patch	2009-11-30 21:35:54 UTC (rev 4811)
@@ -1,15 +0,0 @@
-Index: twisted/runner/procmon.py
-===================================================================
---- twisted/runner/procmon.py	(revision 26969)
-+++ twisted/runner/procmon.py	(working copy)
-@@ -68,6 +68,10 @@
-     def lineReceived(self, line):
-         log.msg('[%s] %s' % (self.tag, line))
- 
-+    def lineLengthExceeded(self, line):
-+        """ Don't disconnect just because the process wrote too big a line """
-+        log.msg('Line length exceeded')
-+
- class LoggingProtocol(protocol.ProcessProtocol):
- 
-     service = None

Deleted: CalendarServer/trunk/lib-patches/Twisted/twisted.web2.auth.digest.patch
===================================================================
--- CalendarServer/trunk/lib-patches/Twisted/twisted.web2.auth.digest.patch	2009-11-30 21:26:16 UTC (rev 4810)
+++ CalendarServer/trunk/lib-patches/Twisted/twisted.web2.auth.digest.patch	2009-11-30 21:35:54 UTC (rev 4811)
@@ -1,82 +0,0 @@
-Index: twisted/web2/auth/digest.py
-===================================================================
---- twisted/web2/auth/digest.py	(revision 26969)
-+++ twisted/web2/auth/digest.py	(working copy)
-@@ -138,11 +138,15 @@
-     implements(credentials.IUsernameHashedPassword,
-                IUsernameDigestHash)
- 
--    def __init__(self, username, method, realm, fields):
-+    def __init__(self, username, method, realm, fields, originalMethod=None):
-         self.username = username
-         self.method = method
-         self.realm = realm
-         self.fields = fields
-+        if originalMethod:
-+            self.originalMethod = originalMethod
-+        else:
-+            self.originalMethod = method
- 
-     def checkPassword(self, password):
-         response = self.fields.get('response')
-@@ -155,11 +159,23 @@
- 
-         expected = calcResponse(
-             calcHA1(algo, self.username, self.realm, password, nonce, cnonce),
--            algo, nonce, nc, cnonce, qop, self.method, uri, None
-+            algo, nonce, nc, cnonce, qop, self.originalMethod, uri, None
-         )
- 
--        return expected == response
-+        if expected == response:
-+            return True
- 
-+        # IE7 sends cnonce and nc values, but auth fails if they are used.
-+        # So try again without them...
-+        # They can be omitted for backwards compatibility [RFC 2069].
-+        if nc is not None or cnonce is not None:
-+            expected = calcResponse(
-+                calcHA1(algo, self.username, self.realm, password, nonce, cnonce),
-+                algo, nonce, None, None, qop, self.originalMethod, uri, None
-+            )
-+            if expected == response:
-+                return True
-+
-     def checkHash(self, digestHash):
-         response = self.fields.get('response')
-         uri = self.fields.get('uri')
-@@ -171,7 +187,7 @@
- 
-         expected = calcResponse(
-             calcHA1(algo, None, None, None, nonce, cnonce, preHA1=digestHash),
--            algo, nonce, nc, cnonce, qop, self.method, uri, None
-+            algo, nonce, nc, cnonce, qop, self.originalMethod, uri, None
-         )
- 
-         return expected == response
-@@ -234,7 +250,7 @@
-         key = "%s,%s,%s" % (nonce, clientip, str(int(self._getTime())))
-         digest = md5(key + self.privateKey).hexdigest()
-         ekey = key.encode('base64')
--        return "%s-%s" % (digest, ekey.strip('\n'))
-+        return "%s-%s" % (digest, ekey.replace('\n', ''))
- 
-     def verifyOpaque(self, opaque, nonce, clientip):
-         """
-@@ -348,7 +364,13 @@
-                              auth.get('nonce'),
-                              request.remoteAddr.host):
- 
-+            if hasattr(request, "originalMethod"):
-+                originalMethod = request.originalMethod
-+            else:
-+                originalMethod = None
-+
-             return succeed(DigestedCredentials(username,
--                                       request.method,
--                                       self.realm,
--                                       auth))
-+                                               request.method,
-+                                               self.realm,
-+                                               auth,
-+                                               originalMethod))

Deleted: CalendarServer/trunk/lib-patches/Twisted/twisted.web2.dav.fileop.patch
===================================================================
--- CalendarServer/trunk/lib-patches/Twisted/twisted.web2.dav.fileop.patch	2009-11-30 21:26:16 UTC (rev 4810)
+++ CalendarServer/trunk/lib-patches/Twisted/twisted.web2.dav.fileop.patch	2009-11-30 21:35:54 UTC (rev 4811)
@@ -1,48 +0,0 @@
-Index: twisted/web2/dav/fileop.py
-===================================================================
---- twisted/web2/dav/fileop.py	(revision 26969)
-+++ twisted/web2/dav/fileop.py	(working copy)
-@@ -162,8 +162,8 @@
- 
-         response = responsecode.NO_CONTENT
- 
--    # Restat filepath since we deleted the backing file
--    filepath.restat(False)
-+    # Remove stat info for filepath since we deleted the backing file
-+    filepath.changed()
- 
-     return succeed(response)
- 
-@@ -371,8 +371,8 @@
-     except OSError:
-         pass
-     else:
--        # Restat source filepath since we moved it
--        source_filepath.restat(False)
-+        # Remove stat info from source filepath since we moved it
-+        source_filepath.changed()
-         yield success_code
-         return
- 
-@@ -462,8 +462,8 @@
-             "writing to file: %s" % (filepath.path,)
-         ))
- 
--    # Restat filepath since we modified the backing file
--    filepath.restat(False)
-+    # Remove stat info from filepath since we modified the backing file
-+    filepath.changed()
-     yield success_code
- 
- put = deferredGenerator(put)
-@@ -480,8 +480,8 @@
-     """
-     try:
-         os.mkdir(filepath.path)
--        # Restat filepath because we modified it
--        filepath.restat(False)
-+        # Remove stat info from filepath because we modified it
-+        filepath.changed()
-     except:
-         raise HTTPError(statusForFailure(
-             Failure(),

Deleted: CalendarServer/trunk/lib-patches/Twisted/twisted.web2.dav.method.report.patch
===================================================================
--- CalendarServer/trunk/lib-patches/Twisted/twisted.web2.dav.method.report.patch	2009-11-30 21:26:16 UTC (rev 4810)
+++ CalendarServer/trunk/lib-patches/Twisted/twisted.web2.dav.method.report.patch	2009-11-30 21:35:54 UTC (rev 4811)
@@ -1,34 +0,0 @@
-Index: twisted/web2/dav/method/report.py
-===================================================================
---- twisted/web2/dav/method/report.py	(revision 26969)
-+++ twisted/web2/dav/method/report.py	(working copy)
-@@ -94,8 +94,9 @@
-     namespace = doc.root_element.namespace
-     name = doc.root_element.name
- 
-+    ok = string.ascii_letters + string.digits + "_"
-+
-     def to_method(s):
--        ok = string.ascii_letters + string.digits + "_"
-         out = []
-         for c in s:
-             if c in ok:
-@@ -105,10 +106,17 @@
-         return "report_" + "".join(out)
- 
-     if namespace:
--        method_name = to_method(namespace + "_" + name)
-+        method_name = to_method("_".join((namespace, name)))
-+
-+        if namespace == davxml.dav_namespace:
-+            request.submethod = "DAV:" + name
-+        else:
-+            request.submethod = "{%s}%s" % (namespace, name)
-     else:
-         method_name = to_method(name)
- 
-+        request.submethod = name
-+
-     try:
-         method = getattr(self, method_name)
-         

Deleted: CalendarServer/trunk/lib-patches/Twisted/twisted.web2.dav.resource.patch
===================================================================
--- CalendarServer/trunk/lib-patches/Twisted/twisted.web2.dav.resource.patch	2009-11-30 21:26:16 UTC (rev 4810)
+++ CalendarServer/trunk/lib-patches/Twisted/twisted.web2.dav.resource.patch	2009-11-30 21:35:54 UTC (rev 4811)
@@ -1,101 +0,0 @@
-Index: twisted/web2/dav/resource.py
-===================================================================
---- twisted/web2/dav/resource.py	(revision 26969)
-+++ twisted/web2/dav/resource.py	(working copy)
-@@ -49,12 +49,14 @@
- if not hasattr(__builtin__, "frozenset"):
-     import sets.ImmutableSet as frozenset
- 
-+import urllib
-+
- from zope.interface import implements
-+from twisted.cred.error import LoginFailed, UnauthorizedLogin
- from twisted.python import log
- from twisted.python.failure import Failure
--from twisted.internet.defer import Deferred, maybeDeferred, succeed
-+from twisted.internet.defer import Deferred, maybeDeferred, succeed, inlineCallbacks
- from twisted.internet.defer import waitForDeferred, deferredGenerator
--from twisted.cred.error import LoginFailed, UnauthorizedLogin
- from twisted.internet import reactor
- from twisted.web2 import responsecode
- from twisted.web2.http import HTTPError, RedirectResponse, StatusResponse
-@@ -642,41 +644,43 @@
-     # Authentication
-     ##
- 
-+    @inlineCallbacks
-     def authorize(self, request, privileges, recurse=False):
-         """
-         See L{IDAVResource.authorize}.
-         """
--        def onAuth(result):
--            def onErrors(failure):
--                failure.trap(AccessDeniedError)
--                
--                # If we were unauthorized to start with (no Authorization header from client) then
--                # we should return an unauthorized response instead to force the client to login if it can
--                if request.authnUser == davxml.Principal(davxml.Unauthenticated()):
--                    d = UnauthorizedResponse.makeResponse(request.credentialFactories,
--                                                                 request.remoteAddr)
--                    def _fail(response):
--                        return Failure(HTTPError(response))
--                    return d.addCallback(_fail)
--                else:
--                    response = NeedPrivilegesResponse(request.uri,
--                                                      failure.value.errors)
--                #
--                # We're not adding the headers here because this response
--                # class is supposed to be a FORBIDDEN status code and
--                # "Authorization will not help" according to RFC2616
--                #
--                raise HTTPError(response)
- 
--            d = self.checkPrivileges(request, privileges, recurse)
--            d.addErrback(onErrors)
--            return d
-+        try:
-+            yield self.authenticate(request)
-+        except (UnauthorizedLogin, LoginFailed), e:
-+            log.msg("Authentication failed: %s" % (e,))
-+            response = (yield UnauthorizedResponse.makeResponse(
-+                request.credentialFactories,
-+                request.remoteAddr
-+            ))
-+            raise HTTPError(response)
- 
--        d = maybeDeferred(self.authenticate, request)
--        d.addCallback(onAuth)
--        return d
-+        try:
-+            yield self.checkPrivileges(request, privileges, recurse)
-+        except AccessDeniedError, e:
-+            # If we were unauthenticated to start with (no Authorization header from client) then
-+            # we should return an unauthorized response instead to force the client to login if it can
-+            if request.authnUser == davxml.Principal(davxml.Unauthenticated()):
-+                response = (yield UnauthorizedResponse.makeResponse(
-+                    request.credentialFactories,
-+                    request.remoteAddr
-+                ))
-+            else:
-+                response = NeedPrivilegesResponse(request.uri, e.errors)
-+            #
-+            # We're not adding the headers here because this response
-+            # class is supposed to be a FORBIDDEN status code and
-+            # "Authorization will not help" according to RFC2616
-+            #
-+            raise HTTPError(response)
- 
- 
-+
-     def authenticate(self, request):
-         if not (
-             hasattr(request, 'portal') and 
-@@ -1880,7 +1884,7 @@
-         # If this is a collection and the URI doesn't end in "/", redirect.
-         #
-         if self.isCollection() and request.path[-1:] != "/":
--            return RedirectResponse(request.unparseURL(path=request.path+'/'))
-+            return RedirectResponse(request.unparseURL(path=urllib.quote(urllib.unquote(request.path), safe=':/')+'/'))
- 
-         def setHeaders(response):
-             response = IResponse(response)

Deleted: CalendarServer/trunk/lib-patches/Twisted/twisted.web2.error.patch
===================================================================
--- CalendarServer/trunk/lib-patches/Twisted/twisted.web2.error.patch	2009-11-30 21:26:16 UTC (rev 4810)
+++ CalendarServer/trunk/lib-patches/Twisted/twisted.web2.error.patch	2009-11-30 21:35:54 UTC (rev 4811)
@@ -1,13 +0,0 @@
-Index: twisted/web2/error.py
-===================================================================
---- twisted/web2/error.py	(revision 26969)
-+++ twisted/web2/error.py	(working copy)
-@@ -92,7 +92,7 @@
-             "<body><h1>%s</h1>%s</body></html>") % (
-         response.code, title, title, message)
-     
--    response.headers.setHeader("content-type", http_headers.MimeType('text', 'html'))
-+    response.headers.setHeader("content-type", http_headers.MimeType('text', 'html', {'charset':'utf-8'}))
-     response.stream = stream.MemoryStream(body)
-     
-     return response

Deleted: CalendarServer/trunk/lib-patches/Twisted/twisted.web2.server.patch
===================================================================
--- CalendarServer/trunk/lib-patches/Twisted/twisted.web2.server.patch	2009-11-30 21:26:16 UTC (rev 4810)
+++ CalendarServer/trunk/lib-patches/Twisted/twisted.web2.server.patch	2009-11-30 21:35:54 UTC (rev 4811)
@@ -1,77 +0,0 @@
-Index: twisted/web2/server.py
-===================================================================
---- twisted/web2/server.py	(revision 26969)
-+++ twisted/web2/server.py	(working copy)
-@@ -26,7 +26,7 @@
- from twisted.web2 import error
- from twisted.web2.dav.util import joinURL
- 
--from twisted.web2 import version as web2_version
-+from twisted.web2 import __version__ as web2_version
- from twisted import __version__ as twisted_version
- 
- VERSION = "Twisted/%s TwistedWeb/%s" % (twisted_version, web2_version)
-@@ -332,6 +332,16 @@
-             response = http.Response(responsecode.OK)
-             response.headers.setHeader('allow', ('GET', 'HEAD', 'OPTIONS', 'TRACE'))
-             return response
-+
-+        elif self.method == "POST":
-+            # Allow other methods to tunnel through using POST and a request header.
-+            # See http://code.google.com/apis/gdata/docs/2.0/basics.html
-+            if self.headers.hasHeader("X-HTTP-Method-Override"):
-+                intendedMethod = self.headers.getRawHeaders("X-HTTP-Method-Override")[0];
-+                if intendedMethod:
-+                    self.originalMethod = self.method
-+                    self.method = intendedMethod
-+
-         # This is where CONNECT would go if we wanted it
-         return None
- 
-@@ -386,6 +396,15 @@
-             # We found a Resource... update the request.prepath and postpath
-             for x in xrange(len(path) - len(newpath)):
-                 self.prepath.append(self.postpath.pop(0))
-+            url = quote("/" + "/".join(self.prepath) + ("/" if self.prepath and self.prepath[-1] else ""))
-+            self._rememberResource(newres, url)
-+        else:
-+            try:
-+                previousURL = self.urlForResource(res)
-+                url = quote(previousURL + path[0] + ("/" if path[0] and len(path) > 1 else ""))
-+                self._rememberResource(newres, url)
-+            except NoURLForResourceError:
-+                pass
- 
-         child = self._getChild(None, newres, newpath, updatepaths=updatepaths)
- 
-@@ -467,13 +486,29 @@
-         segments = unquote(path).split("/")
-         assert segments[0] == "", "URL path didn't begin with '/': %s" % (path,)
- 
-+        # Walk the segments up to see if we can find a cached resource to start from
-+        preSegments = segments[:-1]
-+        postSegments = segments[-1:]
-+        cachedParent = None
-+        while(len(preSegments)):
-+            parentPath = "/".join(preSegments) + "/"
-+            cachedParent = self._resourcesByURL.get(parentPath, None)
-+            if cachedParent is not None:
-+                break
-+            else:
-+                postSegments.insert(0, preSegments.pop())
-+        
-+        if cachedParent is None:
-+            cachedParent = self.site.resource
-+            postSegments = segments[1:]
-+
-         def notFound(f):
-             f.trap(http.HTTPError)
-             if f.value.response.code != responsecode.NOT_FOUND:
-                 return f
-             return None
- 
--        d = defer.maybeDeferred(self._getChild, None, self.site.resource, segments[1:], updatepaths=False)
-+        d = defer.maybeDeferred(self._getChild, None, cachedParent, postSegments, updatepaths=False)
-         d.addCallback(self._rememberResource, path)
-         d.addErrback(notFound)
-         return d

Deleted: CalendarServer/trunk/lib-patches/Twisted/twisted.web2.static.patch
===================================================================
--- CalendarServer/trunk/lib-patches/Twisted/twisted.web2.static.patch	2009-11-30 21:26:16 UTC (rev 4810)
+++ CalendarServer/trunk/lib-patches/Twisted/twisted.web2.static.patch	2009-11-30 21:35:54 UTC (rev 4811)
@@ -1,56 +0,0 @@
-Index: twisted/web2/static.py
-===================================================================
---- twisted/web2/static.py	(revision 26969)
-+++ twisted/web2/static.py	(working copy)
-@@ -213,13 +213,20 @@
-         if indexNames is not None:
-             self.indexNames = indexNames
- 
-+    def comparePath(self, path):
-+        
-+        if isinstance(path, filepath.FilePath):
-+            return path.path == self.fp.path
-+        else:
-+            return path == self.fp.path
-+
-     def exists(self):
-         return self.fp.exists()
- 
-     def etag(self):
-         if not self.fp.exists(): return None
- 
--        st = self.fp.statinfo
-+        st = self.fp.getstatinfo()
- 
-         #
-         # Mark ETag as weak if it was modified more recently than we can
-@@ -317,8 +324,11 @@
-         if child: return child
- 
-         child_fp = self.fp.child(name)
-+        if hasattr(self, "knownChildren"):
-+            if name in self.knownChildren:
-+                child_fp.existsCached = True
-         if child_fp.exists():
--            return self.createSimilarFile(child_fp.path)
-+            return self.createSimilarFile(child_fp)
-         else:
-             return None
- 
-@@ -329,6 +339,7 @@
-         children = self.putChildren.keys()
-         if self.fp.isdir():
-             children += [c for c in self.fp.listdir() if c not in children]
-+            self.knownChildren = set(children)
-         return children
- 
-     def locateChild(self, req, segments):
-@@ -371,7 +382,7 @@
-         return self.createSimilarFile(fpath.path), segments[1:]
- 
-     def renderHTTP(self, req):
--        self.fp.restat(False)
-+        self.fp.changed()
-         return super(File, self).renderHTTP(req)
- 
-     def render(self, req):

Modified: CalendarServer/trunk/support/build.sh
===================================================================
--- CalendarServer/trunk/support/build.sh	2009-11-30 21:26:16 UTC (rev 4810)
+++ CalendarServer/trunk/support/build.sh	2009-11-30 21:35:54 UTC (rev 4811)
@@ -465,7 +465,7 @@
 
   py_dependency "Twisted" "twisted" "Twisted" \
     "svn" "${proto}://svn.twistedmatrix.com/svn/Twisted/branches/dav-take-two-3081-4" \
-    false true true false 26969;
+    false true true false 27612;
 
   # twisted.web2 doesn't get installed by default, so in the install phase
   # let's make sure it does.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20091130/93eb73ce/attachment-0001.html>


More information about the calendarserver-changes mailing list