Whole file
mar10/nutree
The author described this change as “Fix set_data() for clones”. It counts as a record because the check below fails on the code as it stood at 1240de0a8 and passes on c1a691ae8, with nothing else changed between the two runs.
Projectmar10/nutree
Fix saved2021-12-31
Sharing licenceMIT · LICENSE.txt
Change size+5 −3
What the code was meant to do, written into the code itself as a save note
Fix set_data() for clones
The change
| 160 | 160 | node_map[new_data_id].extend(prev_clones) | |
| 161 | 161 | except KeyError: # still a singleton, just a new data_id | |
| 162 | 162 | node_map[new_data_id] = prev_clones | |
| 163 | - | if new_data: | |
| 164 | - | for n in prev_clones: | |
| 163 | + | for n in prev_clones: | |
| 164 | + | n._data_id = new_data_id | |
| 165 | + | if new_data: | |
| 165 | 166 | n._data = new_data | |
| 166 | 167 | else: | |
| 167 | 168 | # Move this one node to another slot in the map | |
| 168 | - | node_map[self._data_id].pop(self) | |
| 169 | + | node_map[self._data_id].remove(self) | |
| 169 | 170 | try: # are we adding to existing clones again? | |
| 170 | 171 | node_map[new_data_id].append(self) | |
| 171 | 172 | except KeyError: # now a singleton with a new data_id | |
| 172 | 173 | node_map[new_data_id] = [self] | |
| 174 | + | self._data_id = new_data_id | |
| 173 | 175 | if new_data: | |
| 174 | 176 | self._data = new_data | |
| 175 | 177 | else: |
The check that tells the two apart
fail→pass·tests/test_core.py::TestNavigate::test_data_id
Check file tests/test_core.py, taken without changes from the fix and copied onto the older code, so the exact same check runs against both versions.
Origin and history
The code before it1240de0a84d63490d3430963ed4b212ee22ad28e
Broken version dated2021-12-31
Modulenutree.node
Units changedNode
Fingerprint99973bbf36652306
Checked2026-08-18 by goldset/0.1
Every field above is generated by our program. None of it is written by hand.