Various small improvements across crates
Most of these changes should be self-explanatory. * Atomic fetch was no longer used * The default policy when initializing should be 'all', as it is with `rad init`.
This commit is contained in:
parent
bb06663d1c
commit
98c94de5e3
|
|
@ -354,6 +354,11 @@ impl PublicKey {
|
|||
refname!("refs/namespaces").join(Component::from(self))
|
||||
}
|
||||
|
||||
#[cfg(feature = "radicle-git-ext")]
|
||||
pub fn to_component(&self) -> radicle_git_ext::ref_format::Component {
|
||||
radicle_git_ext::ref_format::Component::from(self)
|
||||
}
|
||||
|
||||
#[cfg(feature = "radicle-git-ext")]
|
||||
pub fn from_namespaced(
|
||||
refstr: &radicle_git_ext::ref_format::Namespaced,
|
||||
|
|
|
|||
|
|
@ -240,14 +240,6 @@ impl Runtime {
|
|||
}
|
||||
let reactor = Reactor::named(wire, popol::Poller::new(), thread::name(&id, "service"))?;
|
||||
let handle = Handle::new(home.clone(), reactor.controller(), emitter);
|
||||
let atomic = git::version()? >= git::VERSION_REQUIRED;
|
||||
|
||||
if !atomic {
|
||||
log::warn!(
|
||||
target: "node",
|
||||
"Disabling atomic fetches; git version >= {} required", git::VERSION_REQUIRED
|
||||
);
|
||||
}
|
||||
|
||||
let nid = *signer.public_key();
|
||||
let fetch = worker::FetchConfig {
|
||||
|
|
|
|||
|
|
@ -476,10 +476,7 @@ impl<G: cyphernet::Ecdh<Pk = NodeId> + Signer + Clone> Node<G> {
|
|||
.map(|(id, _, _)| id)
|
||||
.unwrap();
|
||||
|
||||
assert!(self
|
||||
.policies
|
||||
.seed(&id, node::policy::Scope::Followed)
|
||||
.unwrap());
|
||||
assert!(self.policies.seed(&id, node::policy::Scope::All).unwrap());
|
||||
|
||||
log::debug!(
|
||||
target: "test",
|
||||
|
|
|
|||
|
|
@ -688,7 +688,7 @@ impl IssueCounts {
|
|||
}
|
||||
}
|
||||
|
||||
impl<'a, R: WriteRepository> Issues<'a, R>
|
||||
impl<'a, R> Issues<'a, R>
|
||||
where
|
||||
R: ReadRepository + cob::Store,
|
||||
{
|
||||
|
|
@ -699,7 +699,12 @@ where
|
|||
|
||||
Ok(Self { raw })
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, R> Issues<'a, R>
|
||||
where
|
||||
R: WriteRepository + cob::Store,
|
||||
{
|
||||
/// Get an issue.
|
||||
pub fn get(&self, id: &ObjectId) -> Result<Option<Issue>, store::Error> {
|
||||
self.raw.get(id)
|
||||
|
|
|
|||
|
|
@ -2241,7 +2241,7 @@ impl<'a, R> Deref for Patches<'a, R> {
|
|||
|
||||
impl<'a, R> Patches<'a, R>
|
||||
where
|
||||
R: ReadRepository + cob::Store + 'static,
|
||||
R: ReadRepository + cob::Store,
|
||||
{
|
||||
/// Open a patches store.
|
||||
pub fn open(repository: &'a R) -> Result<Self, RepositoryError> {
|
||||
|
|
|
|||
|
|
@ -659,7 +659,7 @@ impl FetchResult {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn find_updated(&self, name: &git::RefString) -> Option<RefUpdate> {
|
||||
pub fn find_updated(&self, name: &git::RefStr) -> Option<RefUpdate> {
|
||||
let updated = match self {
|
||||
Self::Success { updated, .. } => Some(updated),
|
||||
_ => None,
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ pub use radicle_git_ext::Oid;
|
|||
use crate::cob;
|
||||
use crate::collections::RandomMap;
|
||||
use crate::git::ext as git_ext;
|
||||
use crate::git::{refspec::Refspec, PatternString, Qualified, RefError, RefString};
|
||||
use crate::git::{refspec::Refspec, PatternString, Qualified, RefError, RefStr, RefString};
|
||||
use crate::identity::{Did, PayloadError};
|
||||
use crate::identity::{Doc, DocAt, DocError};
|
||||
use crate::identity::{Identity, RepoId};
|
||||
|
|
@ -186,12 +186,34 @@ impl RefUpdate {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn name(&self) -> &RefString {
|
||||
match &self {
|
||||
RefUpdate::Updated { name, .. } => name,
|
||||
RefUpdate::Created { name, .. } => name,
|
||||
RefUpdate::Deleted { name, .. } => name,
|
||||
RefUpdate::Skipped { name, .. } => name,
|
||||
/// Get the old OID, if any.
|
||||
pub fn old(&self) -> Option<Oid> {
|
||||
match self {
|
||||
RefUpdate::Updated { old, .. } => Some(*old),
|
||||
RefUpdate::Created { .. } => None,
|
||||
RefUpdate::Deleted { oid, .. } => Some(*oid),
|
||||
RefUpdate::Skipped { oid, .. } => Some(*oid),
|
||||
}
|
||||
}
|
||||
|
||||
/// Get the new OID, if any.
|
||||
#[allow(clippy::new_ret_no_self)]
|
||||
pub fn new(&self) -> Option<Oid> {
|
||||
match self {
|
||||
RefUpdate::Updated { new, .. } => Some(*new),
|
||||
RefUpdate::Created { oid, .. } => Some(*oid),
|
||||
RefUpdate::Deleted { .. } => None,
|
||||
RefUpdate::Skipped { .. } => None,
|
||||
}
|
||||
}
|
||||
|
||||
/// Get the ref name.
|
||||
pub fn name(&self) -> &RefStr {
|
||||
match self {
|
||||
RefUpdate::Updated { name, .. } => name.as_refstr(),
|
||||
RefUpdate::Created { name, .. } => name.as_refstr(),
|
||||
RefUpdate::Deleted { name, .. } => name.as_refstr(),
|
||||
RefUpdate::Skipped { name, .. } => name.as_refstr(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue