(self, zone: Zone, replacement: bool = False)
| 1011 | |
| 1012 | class WritableVersion(Version): |
| 1013 | def __init__(self, zone: Zone, replacement: bool = False): |
| 1014 | # The zone._versions_lock must be held by our caller in a versioned |
| 1015 | # zone. |
| 1016 | id = zone._get_next_version_id() |
| 1017 | super().__init__(zone, id) |
| 1018 | if not replacement: |
| 1019 | # We copy the map, because that gives us a simple and thread-safe |
| 1020 | # way of doing versions, and we have a garbage collector to help |
| 1021 | # us. We only make new node objects if we actually change the |
| 1022 | # node. |
| 1023 | self.nodes.update(zone.nodes) |
| 1024 | # We have to copy the zone origin as it may be None in the first |
| 1025 | # version, and we don't want to mutate the zone until we commit. |
| 1026 | self.origin = zone.origin |
| 1027 | self.changed: Set[dns.name.Name] = set() |
| 1028 | |
| 1029 | def _maybe_cow_with_name( |
| 1030 | self, name: dns.name.Name |
nothing calls this directly
no test coverage detected