equal
deleted
inserted
replaced
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 |