MCPcopy
hub / github.com/borgbackup/borg / replace

Method replace

src/borg/helpers/lrucache.py:48–52  ·  view source on GitHub ↗

Replace an item that is already present, not disposing it in the process.

(self, key: K, value: V)

Source from the content-addressed store, hash-verified

46 return len(self._cache)
47
48 def replace(self, key: K, value: V) -> None:
49 """Replace an item that is already present, not disposing it in the process."""
50 # this method complements __setitem__ which should be used for the normal use case.
51 assert key in self._cache, "Unexpected attempt to update a non-existing item."
52 self._cache[key] = value
53
54 def clear(self) -> None:
55 for value in self._cache.values():

Callers 15

setup.pyFile · 0.80
acquireMethod · 0.80
readMethod · 0.80
rename_tmpMethod · 0.80
get_fdMethod · 0.80
readMethod · 0.80
translateMethod · 0.80
export_qrMethod · 0.80
import_paperkeyMethod · 0.80
slashifyFunction · 0.80
remove_dotdot_prefixesFunction · 0.80
SortBySpecFunction · 0.80

Calls

no outgoing calls

Tested by 10

_corrupt_indexFunction · 0.64
rename_indexFunction · 0.64
utcfromtimestampFunction · 0.64
test_transfer_upgradeFunction · 0.64
test_archived_pathsFunction · 0.64
test_repository_moveFunction · 0.64