def __get_cset_at_ts(repo, sha, ts): try: cset = CSet.get(CSet.repo == repo, CSet.hkey == sha, CSet.time == ts) except CSet.DoesNotExist: return None return cset
def __remove_cset(repo, sha, ts): # remove cset try: cset = CSet.get(CSet.repo == repo, CSet.hkey == sha, CSet.time == ts) count = cset.delete_instance() except CSet.DoesNotExist: return None # remove blob try: blob = Blob.get(Blob.repo == repo, Blob.hkey == sha, Blob.time == ts) blob.delete_instance() except Blob.DoesNotExist: return None