mercurial/util.py
branchstable
changeset 33624 524b13fc711f
parent 33549 9a2ee9591acc
child 33648 0b3fe3910ef5
child 33762 86aca74a063b
equal deleted inserted replaced
33623:6788e648efcf 33624:524b13fc711f
   581 
   581 
   582     def __setitem__(self, key, value):
   582     def __setitem__(self, key, value):
   583         if key in self:
   583         if key in self:
   584             del self[key]
   584             del self[key]
   585         super(sortdict, self).__setitem__(key, value)
   585         super(sortdict, self).__setitem__(key, value)
       
   586 
       
   587     if pycompat.ispypy:
       
   588         # __setitem__() isn't called as of PyPy 5.8.0
       
   589         def update(self, src):
       
   590             if isinstance(src, dict):
       
   591                 src = src.iteritems()
       
   592             for k, v in src:
       
   593                 self[k] = v
   586 
   594 
   587 @contextlib.contextmanager
   595 @contextlib.contextmanager
   588 def acceptintervention(tr=None):
   596 def acceptintervention(tr=None):
   589     """A context manager that closes the transaction on InterventionRequired
   597     """A context manager that closes the transaction on InterventionRequired
   590 
   598