Arrange the caches to help look up the given revision.
431911
def seek(self, rev):
        """"""
        # TODO: binary search? Perhaps only when one or the other
        # stack is very large?
        if not self:
            return
        if type(rev) is not int:
            raise TypeError("rev must be int")
        past = self._past
        future = self._future
        if future:
            appender = past.append
            popper = future.pop
            future_start = future[-1][0]
            while future_start <= rev:
                appender(popper())
                if future:
                    future_start = future[-1][0]
                else:
                    break
        if past:
            popper = past.pop
            appender = future.append
            past_end = past[-1][0]
            while past_end > rev:
                appender(popper())
                if past:
                    past_end = past[-1][0]
                else:
                    break
980909
def save(self):
        """"""
        data = [i.asdict() for i in self._revisions.values()]
        logger.debug("Saving data")
        cache.store_archiver_index(self.config, self.archiver, data)
1172336
def _get_revision(self):
        
        assert self._revisions, "no migration revision exist"
        revision = self._rev or self._revisions[-1]
        # revision count must be less or equal since revisions are ordered
        assert revision in self._revisions, "invalid revision specified"
        return revision
523147
def get_cached_menus():
    """"""
    items = cache.get(CACHE_KEY)
    if items is None:
        menu = generate_menu()
        cache.set(CACHE_KEY, menu.items)
    else:
        menu = Menu(items)
    return menu
518291
def _update_cache(self):
        
        fields = connections[self.connection_alias].get_unified_index().all_searchfields()
        if self._fields != fields:
            self._fields = fields
            self._content_field_name, self._schema = self.build_schema(self._fields)
699835
def rev(self, rev):
        """"""
        d = self.dict
        d['revision'] = rev
        return self.from_dict(d)
711647
def checkout(self, revision, options):
        
        rev = revision.key
        self.repo.git.checkout(rev)
577804
public void setRevisions(java.util.Collection<RevisionInfo> revisions) {
        if (revisions == null) {
            this.revisions = null;
            return;
        }

        this.revisions = new com.amazonaws.internal.SdkInternalList<RevisionInfo>(revisions);
    }
690583
@RequestMapping(value = "changelog/{uuid}/revisions", method = RequestMethod.GET)
    public SVNChangeLogRevisions changeLogRevisions(@PathVariable String uuid) {
        // Gets the change log
        SVNChangeLog changeLog = getChangeLog(uuid);
        // Cached?
        SVNChangeLogRevisions revisions = changeLog.getRevisions();
        if (revisions != null) {
            return revisions;
        }
        // Loads the revisions
        revisions = changeLogService.getChangeLogRevisions(changeLog);
        // Stores in cache
        logCache.put(uuid, changeLog.withRevisions(revisions));
        // OK
        return revisions;
    }
103382
public void setRevisions(java.util.Collection<ConfigurationRevision> revisions) {
        if (revisions == null) {
            this.revisions = null;
            return;
        }

        this.revisions = new java.util.ArrayList<ConfigurationRevision>(revisions);
    }
1344415
def _save_cache(self, filename, section_number_of_pages, page_references):
        """"""
        cache_path = Path(filename).with_suffix(self.CACHE_EXTENSION)
        with cache_path.open('wb') as file:
            cache = (section_number_of_pages, page_references)
            pickle.dump(cache, file)
283454
def revision(directory, message, autogenerate, sql, head, splice, branch_label,
             version_path, rev_id):
    """"""
    _revision(directory, message, autogenerate, sql, head, splice,
              branch_label, version_path, rev_id)
295784
def refresh_cache(self, if_want_update=False):
        """"""
        for thread in tuple(self._thread_cache.values()):
            if if_want_update:
                if not thread.want_update:
                    continue
            thread.update()
584838
function() {
            var s = Storage.storage();
            if (s == null) {
                return false;
            }
            Object.keys(s).forEach(function(key){
                if (key.indexOf("cache_") == 0 && key.indexOf("cache_"+configs.revision) ) {
                    s.removeItem(key);
                }
            });
        }
673003
function() {

        var _this = this,
            base = this.__base();

        if (this.revision === 'HEAD') return base;

        return Q.all(this.paths.map(function(path) {
                return QFS.exists(PATH.resolve(_this.root, _this.target, path))
                    .then(function(exists) {
                        return exists && _this.getInfo(path)
                            .then(function(info) {
                                return String(info.revision) === String(_this.revision);
                            });
                });

            }))
            .then(function(checks) {

                return checks.reduce(function(cur, prev) {
                    return cur && prev;
                }, true) || base;

            });

    }
740619
private void persistCaches() {
		for (Entry<CacheKey, Map<String, String>> cacheEntry : caches.entrySet()) {
			persistCache(cacheEntry.getKey().projectName, cacheEntry.getKey().projectVersion, cacheEntry.getValue());
		}
	}
843306
def update_hash_prefix_cache(self):
        """"""
        try:
            self.storage.cleanup_full_hashes()
            self.storage.commit()
            self._sync_threat_lists()
            self.storage.commit()
            self._sync_hash_prefix_cache()
        except Exception:
            self.storage.rollback()
            raise