id_remap[nid], or None to keep nid. A contested key stays on an item whose file holds its own node with that id and did not mint the key; everything else (the owner's file, or a file that only REFERS to the owner) renames as before.
(nid, owner_sf)
| 13838 | held.setdefault(_k, set()).add(_resolved(_sf)) |
| 13839 | |
| 13840 | def _remapped(nid, owner_sf): |
| 13841 | """id_remap[nid], or None to keep nid. A contested key stays on an item whose |
| 13842 | file holds its own node with that id and did not mint the key; everything else |
| 13843 | (the owner's file, or a file that only REFERS to the owner) renames as before.""" |
| 13844 | new = id_remap.get(nid) |
| 13845 | if new is None or nid not in contested: |
| 13846 | return new |
| 13847 | try: |
| 13848 | if not owner_sf: |
| 13849 | return new |
| 13850 | f = _resolved(owner_sf) |
| 13851 | if f in id_owner[nid]: |
| 13852 | return new |
| 13853 | return None if f in held[nid] else new |
| 13854 | except (OSError, RuntimeError): |
| 13855 | return new |
| 13856 | |
| 13857 | if id_remap: |
| 13858 | for n in all_nodes: |