cubicweb/server/repository.py
changeset 12542 85194bd49119
parent 12508 a8c1ea390400
child 12567 26744ad37953
equal deleted inserted replaced
12541:bbbccb0b3a66 12542:85194bd49119
    26 * handles session management
    26 * handles session management
    27 """
    27 """
    28 
    28 
    29 from __future__ import print_function
    29 from __future__ import print_function
    30 
    30 
    31 from warnings import warn
       
    32 from itertools import chain
    31 from itertools import chain
    33 from contextlib import contextmanager
    32 from contextlib import contextmanager
    34 from logging import getLogger
    33 from logging import getLogger
    35 
    34 
    36 from six.moves import range, queue
    35 from six.moves import range, queue
   822         """delete a list of  entities and all related entities from the repository"""
   821         """delete a list of  entities and all related entities from the repository"""
   823         # mark eids as being deleted in cnx info and setup cache update
   822         # mark eids as being deleted in cnx info and setup cache update
   824         # operation (register pending eids before actual deletion to avoid
   823         # operation (register pending eids before actual deletion to avoid
   825         # multiple call to glob_delete_entities)
   824         # multiple call to glob_delete_entities)
   826         op = hook.CleanupDeletedEidsCacheOp.get_instance(cnx)
   825         op = hook.CleanupDeletedEidsCacheOp.get_instance(cnx)
   827         if not isinstance(eids, (set, frozenset)):
       
   828             warn('[3.13] eids should be given as a set', DeprecationWarning,
       
   829                  stacklevel=2)
       
   830             eids = frozenset(eids)
       
   831         eids = eids - op._container
   826         eids = eids - op._container
   832         op._container |= eids
   827         op._container |= eids
   833         data_by_etype = {}  # values are [list of entities]
   828         data_by_etype = {}  # values are [list of entities]
   834         #
   829         #
   835         # WARNING: the way this dictionary is populated is heavily optimized
   830         # WARNING: the way this dictionary is populated is heavily optimized