MCPcopy Index your code
hub / github.com/emwalker/digraph / save_topic

Method save_topic

backend/src/git/client.rs:666–690  ·  view source on GitHub ↗
(&mut self, repo_id: RepoId, topic: &RepoTopic)

Source from the content-addressed store, hash-verified

664 }
665
666 pub fn save_topic(&mut self, repo_id: RepoId, topic: &RepoTopic) -> Result<()> {
667 self.check_can_update(repo_id)?;
668
669 let topic_id = topic.topic_id();
670 let view = self.client.view(repo_id)?;
671 let before = view.topic(topic_id)?;
672 self.indexer
673 .update_synonyms(&self.client, repo_id, &before, topic)?;
674
675 let before = self.client.topic_searches(repo_id, before)?;
676 let after = self
677 .client
678 .topic_searches(repo_id, Some(topic.to_owned()))?;
679 self.indexer.update(
680 &self.client,
681 repo_id,
682 &topic.to_search_entry(),
683 &before,
684 &after,
685 )?;
686 let s = serde_yaml::to_string(&topic)?;
687 let oid = self.client.repo(repo_id)?.add_blob(s.as_bytes())?;
688
689 self.save_object(repo_id, topic_id, oid)
690 }
691
692 pub fn synonym_phrase_matches(
693 &self,

Callers 6

callMethod · 0.80
callMethod · 0.80
callMethod · 0.80
persist_repo_topicMethod · 0.80
persist_topicFunction · 0.80

Calls 13

to_stringFunction · 0.85
check_can_updateMethod · 0.80
update_synonymsMethod · 0.80
topic_searchesMethod · 0.80
updateMethod · 0.80
to_search_entryMethod · 0.80
add_blobMethod · 0.80
as_bytesMethod · 0.80
save_objectMethod · 0.80
topic_idMethod · 0.45
viewMethod · 0.45
topicMethod · 0.45

Tested by 1