Logo Search packages:      
Sourcecode: rabbitvcs version File versions  Download package

def rabbitvcs::lib::vcs::svn::SVN::status_with_cache (   self,
  path,
  invalidate = False,
  recurse = True 
)


Look up the status for path.

If invalidate is set to False this function will look to see if a 
status for the requested path is available in the cache and if so
return that. Otherwise it will bypass the cache entirely.

@type   path: string
@param  path: A path pointing to an item (file or directory).

@type   invalidate: boolean
@param  invalidate: Whether or not the cache should be bypassed.

@type   recurse: boolean
@param  recurse: Should status recurse or not

@rtype:        list of PysvnStatus
@return:       A list of statuses for the given path, with the status
       for the path being the first item in the list.

Definition at line 357 of file __init__.py.

00357                                                                      :
        """
        
        Look up the status for path.
        
        If invalidate is set to False this function will look to see if a 
        status for the requested path is available in the cache and if so
        return that. Otherwise it will bypass the cache entirely.
        
        @type   path: string
        @param  path: A path pointing to an item (file or directory).
        
        @type   invalidate: boolean
        @param  invalidate: Whether or not the cache should be bypassed.

        @type   recurse: boolean
        @param  recurse: Should status recurse or not
        
        @rtype:        list of PysvnStatus
        @return:       A list of statuses for the given path, with the status
                       for the path being the first item in the list.
        
        """

        if (not invalidate and path in self.status_cache):
            return self.status_cache[path]  

        # The cache was bypassed or does not contain the requested path.
        statuses = self.status(path, recurse=recurse)
        
        # Empty out all the caches
        for status in statuses:
            current_path = os.path.join(path, status.data["path"].encode("utf-8"))
            while current_path != "/":
                self.status_cache[current_path] = []
                current_path = os.path.split(current_path)[0]
        
        # Fill them back up
        for status in statuses:
            current_path = os.path.join(path, status.data["path"].encode("utf-8"))
            while current_path != "/":
                if current_path not in self.status_cache: break;
                self.status_cache[current_path].append(status)
                current_path = os.path.split(current_path)[0]
        
        return self.status_cache[path]
        
    #
    # is


Generated by  Doxygen 1.6.0   Back to index