'Return nonempty if the object exists in the index files.'

def exists(self, hash, want_source=False):

    global _total_searches
    _total_searches += 1
    if (hash in self.also):
        return True
    if (self.do_bloom and self.bloom):
        if self.bloom.exists(hash):
            self.do_bloom = False
        else:
            _total_searches -= 1
            return None
    for i in xrange(len(self.packs)):
        p = self.packs[i]
        _total_searches -= 1
        ix = p.exists(hash, want_source=want_source)
        if ix:
            self.packs = (([p] + self.packs[:i]) + self.packs[(i + 1):])
            return ix
    self.do_bloom = True
    return None
