mirror of
https://seed.radicle.dev/rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5.git
synced 2026-11-28 21:50:26 +08:00
Make ReadStorage more usable
Previously, we were not able to access a `ReadRepository` instance through `ReadStorage`. With this change, we are able to.
This commit is contained in:
@@ -83,7 +83,7 @@ pub fn run(options: Options, ctx: impl term::Context) -> anyhow::Result<()> {
|
||||
let signer = term::signer(&profile)?;
|
||||
let storage = &profile.storage;
|
||||
let (_, id) = radicle::rad::cwd()?;
|
||||
let repo = storage.repository(id)?;
|
||||
let repo = storage.repository_mut(id)?;
|
||||
let mut issues = issue::Issues::open(*signer.public_key(), &repo)?;
|
||||
|
||||
let mut issue = issues.get_mut(&options.id).map_err(|err| match err {
|
||||
|
||||
@@ -7,7 +7,6 @@ use anyhow::Context as _;
|
||||
use radicle::prelude::*;
|
||||
use radicle::storage::git::transport;
|
||||
use radicle::storage::RemoteId;
|
||||
use radicle::storage::WriteStorage;
|
||||
|
||||
use crate::project;
|
||||
use crate::terminal as term;
|
||||
|
||||
@@ -15,7 +15,6 @@ use radicle::prelude::*;
|
||||
use radicle::rad;
|
||||
use radicle::storage;
|
||||
use radicle::storage::git::{ProjectError, Storage};
|
||||
use radicle::storage::WriteStorage;
|
||||
|
||||
use crate::commands::rad_checkout as checkout;
|
||||
use crate::project;
|
||||
|
||||
@@ -10,7 +10,6 @@ use radicle::cob::store;
|
||||
use radicle::cob::thread;
|
||||
use radicle::prelude::*;
|
||||
use radicle::storage;
|
||||
use radicle::storage::WriteStorage;
|
||||
|
||||
use crate::terminal as term;
|
||||
use crate::terminal::args::{Args, Error, Help};
|
||||
|
||||
@@ -19,7 +19,7 @@ where
|
||||
.get(&profile.public_key, id)?
|
||||
.context("No project with such ID exists")?;
|
||||
|
||||
let repo = storage.repository(id)?;
|
||||
let repo = storage.repository_mut(id)?;
|
||||
|
||||
if !project.is_delegate(me) {
|
||||
return Err(anyhow::anyhow!(
|
||||
|
||||
@@ -19,7 +19,7 @@ where
|
||||
.get(&profile.public_key, id)?
|
||||
.context("No project with such ID exists")?;
|
||||
|
||||
let repo = storage.repository(id)?;
|
||||
let repo = storage.repository_mut(id)?;
|
||||
|
||||
if !project.is_delegate(me) {
|
||||
return Err(anyhow::anyhow!(
|
||||
|
||||
@@ -4,7 +4,7 @@ use std::str::FromStr;
|
||||
use anyhow::{anyhow, Context as _};
|
||||
|
||||
use radicle::identity::Id;
|
||||
use radicle::storage::{ReadStorage, WriteRepository, WriteStorage};
|
||||
use radicle::storage::{ReadStorage, WriteRepository};
|
||||
|
||||
use crate::terminal as term;
|
||||
use crate::terminal::args::{Args, Error, Help};
|
||||
|
||||
@@ -5,7 +5,7 @@ use radicle::cob::identity::{self, Proposal, ProposalId, Proposals, Revision, Re
|
||||
use radicle::git::Oid;
|
||||
use radicle::identity::Identity;
|
||||
use radicle::prelude::Doc;
|
||||
use radicle::storage::WriteStorage as _;
|
||||
use radicle::storage::ReadStorage as _;
|
||||
use radicle_crypto::{PublicKey, Verified};
|
||||
|
||||
use crate::terminal::args::{Args, Error, Help};
|
||||
|
||||
@@ -11,7 +11,7 @@ use json_color::{Color, Colorizer};
|
||||
use radicle::crypto::Unverified;
|
||||
use radicle::identity::Untrusted;
|
||||
use radicle::identity::{Doc, Id};
|
||||
use radicle::storage::{ReadRepository, ReadStorage, WriteStorage};
|
||||
use radicle::storage::{ReadRepository, ReadStorage};
|
||||
|
||||
use crate::terminal as term;
|
||||
use crate::terminal::args::{Args, Error, Help};
|
||||
|
||||
@@ -198,7 +198,7 @@ pub fn run(options: Options, ctx: impl term::Context) -> anyhow::Result<()> {
|
||||
let signer = term::signer(&profile)?;
|
||||
let storage = &profile.storage;
|
||||
let (_, id) = radicle::rad::cwd()?;
|
||||
let repo = storage.repository(id)?;
|
||||
let repo = storage.repository_mut(id)?;
|
||||
let mut issues = Issues::open(*signer.public_key(), &repo)?;
|
||||
|
||||
match options.op {
|
||||
|
||||
@@ -3,7 +3,7 @@ use std::ffi::OsString;
|
||||
use crate::terminal as term;
|
||||
use crate::terminal::args::{Args, Error, Help};
|
||||
|
||||
use radicle::storage::{ReadRepository, WriteStorage};
|
||||
use radicle::storage::{ReadRepository, ReadStorage};
|
||||
|
||||
pub const HELP: Help = Help {
|
||||
name: "ls",
|
||||
|
||||
@@ -4,7 +4,7 @@ use std::str::FromStr;
|
||||
use anyhow::{anyhow, Context as _};
|
||||
|
||||
use radicle::node::{Handle, NodeId};
|
||||
use radicle::storage::WriteStorage;
|
||||
use radicle::storage::ReadStorage;
|
||||
|
||||
use crate::terminal as term;
|
||||
use crate::terminal::args::{Args, Error, Help};
|
||||
|
||||
@@ -83,7 +83,7 @@ pub fn run(options: Options, ctx: impl term::Context) -> anyhow::Result<()> {
|
||||
let signer = term::signer(&profile)?;
|
||||
let storage = &profile.storage;
|
||||
let (_, id) = radicle::rad::cwd()?;
|
||||
let repo = storage.repository(id)?;
|
||||
let repo = storage.repository_mut(id)?;
|
||||
let mut issues = issue::Issues::open(*signer.public_key(), &repo)?;
|
||||
|
||||
let mut issue = issues.get_mut(&options.id).map_err(|err| match err {
|
||||
|
||||
@@ -5,7 +5,7 @@ use anyhow::{anyhow, Context as _};
|
||||
use radicle::identity::Id;
|
||||
use radicle::node::Handle;
|
||||
use radicle::prelude::*;
|
||||
use radicle::storage::WriteStorage;
|
||||
use radicle::storage::ReadStorage;
|
||||
|
||||
use crate::terminal as term;
|
||||
use crate::terminal::args::{Args, Error, Help};
|
||||
|
||||
Reference in New Issue
Block a user