MCPcopy Create free account
hub / github.com/Vector35/binaryninja-api / create_snapshot

Method create_snapshot

python/collaboration/file.py:345–365  ·  view source on GitHub ↗

Create a new snapshot on the remote (and pull it) :param name: Snapshot name :param contents: Snapshot contents :param analysis_cache_contents: Contents of analysis cache of snapshot :param file: New file contents (if contents changed) :param parent_ids: List of ids of parent snapshots

(self, name: str, contents: bytes, analysis_cache_contents: bytes, file: bytes, parent_ids: List[str], progress: 'util.ProgressFuncType' = util.nop)

Source from the content-addressed store, hash-verified

343 raise RuntimeError(util._last_error())
344
345 def create_snapshot(self, name: str, contents: bytes, analysis_cache_contents: bytes, file: bytes, parent_ids: List[str], progress: 'util.ProgressFuncType' = util.nop) -> 'snapshot.CollabSnapshot':
346 """
347 Create a new snapshot on the remote (and pull it)
348
349 :param name: Snapshot name
350 :param contents: Snapshot contents
351 :param analysis_cache_contents: Contents of analysis cache of snapshot
352 :param file: New file contents (if contents changed)
353 :param parent_ids: List of ids of parent snapshots (or empty if this is a root snapshot)
354 :param progress: Function to call on progress updates
355 :return: Reference to the created snapshot
356 :raises: RuntimeError if there was an error
357 """
358 array = (ctypes.c_char_p * len(parent_ids))()
359 for i in range(len(parent_ids)):
360 array[i] = parent_ids[i]
361
362 value = core.BNRemoteFileCreateSnapshot(self._handle, name, contents, len(contents), analysis_cache_contents, len(analysis_cache_contents), file, len(file), array, len(parent_ids), util.wrap_progress(progress), None)
363 if value is None:
364 raise RuntimeError(util._last_error())
365 return snapshot.CollabSnapshot(value)
366
367 def delete_snapshot(self, snapshot: 'snapshot.CollabSnapshot'):
368 """

Callers

nothing calls this directly

Calls 1

CollabSnapshotMethod · 0.80

Tested by

no test coverage detected