MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / set_ref_mapping

Method set_ref_mapping

atomic-repository/src/repository/ref_mapping.rs:97–110  ·  view source on GitHub ↗

Upsert (or remove, with `None`) the mapping for `view` under a journaled `RefMapping` metadata operation (CB-10A task 1). The lease compares the complete canonical mapping encoding, so a concurrent mapping move between prepare and apply fails closed.

(
        &self,
        working_copy: WorkingCopyId,
        view: &str,
        mapping: Option<RefMapping>,
    )

Source from the content-addressed store, hash-verified

95 /// The lease compares the complete canonical mapping encoding, so a
96 /// concurrent mapping move between prepare and apply fails closed.
97 pub fn set_ref_mapping(
98 &self,
99 working_copy: WorkingCopyId,
100 view: &str,
101 mapping: Option<RefMapping>,
102 ) -> Result<Option<atomic_core::OperationId>, RepositoryError> {
103 self.set_ref_mapping_under_lease(
104 working_copy,
105 view,
106 MappingLease::Unconditional,
107 mapping,
108 None,
109 )
110 }
111
112 /// [`Self::set_ref_mapping`] for a caller that already holds the common
113 /// operation lock: the working-copy lock aliases the held guard instead

Calls 1