introduce the virtual filesystem everywhere

this unfortunately means I had to cut some features (bye bye commit history! for now)
stuff's not quite 100% working just yet (like branch links, which were and are still broken)
we also don't have content_version impls just yet
This commit is contained in:
りき萌 2024-11-17 22:34:43 +01:00
parent db0329077e
commit 377fbe4dab
42 changed files with 1613 additions and 1655 deletions

View file

@ -1,4 +1,4 @@
use std::{collections::HashMap, ops::Range, path::PathBuf};
use std::{collections::HashMap, ops::Range};
use anyhow::Context;
use codespan_reporting::{
@ -6,26 +6,19 @@ use codespan_reporting::{
files::SimpleFiles,
term::termcolor::{ColorChoice, StandardStream},
};
use serde::Serialize;
use ulid::Ulid;
use crate::tree::{SemaBranchId, SemaRoots, SemaTree};
#[derive(Debug, Clone, Serialize)]
pub struct RevisionInfo {
pub is_latest: bool,
pub number: usize,
pub commit: String,
pub commit_short: String,
}
use crate::{
tree::{SemaBranchId, SemaRoots, SemaTree},
vfs::VPathBuf,
};
#[derive(Debug, Clone)]
pub enum Source {
Tree {
input: String,
tree_path: String,
target_path: PathBuf,
revision_info: RevisionInfo,
target_path: VPathBuf,
},
Other(String),
}
@ -103,13 +96,6 @@ impl Treehouse {
}
}
pub fn revision_info(&self, file_id: FileId) -> Option<&RevisionInfo> {
match self.source(file_id) {
Source::Tree { revision_info, .. } => Some(revision_info),
Source::Other(_) => None,
}
}
pub fn next_missingno(&mut self) -> Ulid {
self.missingno_generator
.generate()