From 788b87ecebad798b7d555aaa93d5b32ee5e559be Mon Sep 17 00:00:00 2001 From: asonix Date: Sun, 12 Feb 2023 23:13:47 -0600 Subject: [PATCH] Remove obsolute pre-0.3 migrate check --- src/repo/old.rs | 2 ++ src/repo/old/migrate.rs | 2 +- src/repo/old/migrate/s034.rs | 12 ------------ 3 files changed, 3 insertions(+), 13 deletions(-) diff --git a/src/repo/old.rs b/src/repo/old.rs index 7fe1a27..e99febf 100644 --- a/src/repo/old.rs +++ b/src/repo/old.rs @@ -65,6 +65,8 @@ impl Old { } pub(super) fn hashes(&self) -> impl std::iter::Iterator { + let length = self.filename_tree.len(); + tracing::info!("FILENAME_TREE_LEN: {}", length); self.filename_tree .iter() .values() diff --git a/src/repo/old/migrate.rs b/src/repo/old/migrate.rs index ab37156..7af3829 100644 --- a/src/repo/old/migrate.rs +++ b/src/repo/old/migrate.rs @@ -82,7 +82,7 @@ enum DbVersion { impl DbVersion { fn exists(root: PathBuf) -> Self { - if s034::exists(root.clone()) && !s034::migrating(root) { + if s034::exists(root.clone()) { return DbVersion::Sled034; } diff --git a/src/repo/old/migrate/s034.rs b/src/repo/old/migrate/s034.rs index 628fbd9..60a1176 100644 --- a/src/repo/old/migrate/s034.rs +++ b/src/repo/old/migrate/s034.rs @@ -14,18 +14,6 @@ pub(crate) fn exists(mut base: PathBuf) -> bool { std::fs::metadata(base).is_ok() } -pub(crate) fn migrating(base: PathBuf) -> bool { - if let Ok(db) = open(base) { - if let Ok(tree) = db.open_tree("migrate") { - if let Ok(Some(_)) = tree.get("done") { - return false; - } - } - } - - true -} - pub(crate) fn open(mut base: PathBuf) -> Result { base.push("sled"); base.push(SLED_034);