'Return the maximum revision for all files under a given location'

def get_revision(self, location):

    revision = 0
    for (base, dirs, files) in os.walk(location):
        if (self.dirname not in dirs):
            dirs[:] = []
            continue
        dirs.remove(self.dirname)
        entries_fn = os.path.join(base, self.dirname, 'entries')
        if (not os.path.exists(entries_fn)):
            continue
        (dirurl, localrev) = self._get_svn_url_rev(base)
        if (base == location):
            base_url = (dirurl + '/')
        elif ((not dirurl) or (not dirurl.startswith(base_url))):
            dirs[:] = []
            continue
        revision = max(revision, localrev)
    return revision
