MCPcopy Create free account
hub / github.com/emwalker/digraph / persist_repo_topic

Method persist_repo_topic

backend/src/git/topic.rs:632–658  ·  view source on GitHub ↗
(
        &self,
        mut mutation: Mutation,
        store: &S,
        child: RepoTopic,
        mut parent: RepoTopic,
        parent_topics: BTreeSet<ParentTopic>,
    )

Source from the content-addressed store, hash-verified

630 }
631
632 fn persist_repo_topic<S>(
633 &self,
634 mut mutation: Mutation,
635 store: &S,
636 child: RepoTopic,
637 mut parent: RepoTopic,
638 parent_topics: BTreeSet<ParentTopic>,
639 ) -> Result<UpsertTopicResult>
640 where
641 S: SaveChangesForPrefix,
642 {
643 let date = chrono::Utc::now();
644 parent.children.insert(child.to_topic_child(date));
645
646 let change = self.change(&child, &parent_topics, &parent, date);
647 mutation.save_topic(self.repo_id, &child)?;
648 mutation.save_topic(self.repo_id, &parent)?;
649 mutation.add_change(self.repo_id, &change)?;
650 mutation.write(store)?;
651
652 Ok(UpsertTopicResult {
653 alerts: vec![],
654 matching_repo_topics: BTreeSet::new(),
655 repo_topic: Some(child),
656 saved: true,
657 })
658 }
659
660 fn update_repo_topic<S>(
661 &self,

Callers 2

add_repo_topicMethod · 0.80
update_repo_topicMethod · 0.80

Calls 6

insertMethod · 0.80
to_topic_childMethod · 0.80
save_topicMethod · 0.80
changeMethod · 0.45
add_changeMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected