pub struct RemoteDelta<T: MutTxnTExt + TxnTExt> {
pub inodes: HashSet<Position<Hash>>,
pub to_download: Vec<CS>,
pub remote_ref: Option<RemoteRef<T>>,
pub ours_ge_dichotomy_set: HashSet<CS>,
pub theirs_ge_dichotomy_set: HashSet<CS>,
pub theirs_ge_dichotomy: Vec<(u64, Hash, Merkle, bool)>,
pub remote_unrecs: Vec<(u64, CS)>,
}
Expand description
For a RemoteRepo
that’s Local, Ssh, or Http
(anything other than a LocalChannel),
RemoteDelta
contains data about the difference between
the “actual” state of the remote (‘theirs’) and the last version of it
that we cached (‘ours’). The dichotomy is the last point at which the two
were the same. remote_unrecs
is a list of changes which used to be
present in the remote, AND were present in the current channel we’re
pulling to or pushing from. The significance of that is that if we knew
about a certain change but did not pull it, the user won’t be notified
if it’s unrecorded in the remote.
If the remote we’re pulling from or pushing to is a LocalChannel,
(meaning it’s just a different channel of the repo we’re already in), then
ours_ge_dichotomy
, theirs_ge_dichotomy
, and remote_unrecs
will be empty
since they have no meaning. If we’re pulling from a LocalChannel,
there’s no cache to have diverged from, and if we’re pushing to a LocalChannel,
we’re not going to suddenly be surprised by the presence of unknown changes.
This struct will be created by both a push and pull operation since both
need to update the changelist and will at least try to update the local
remote cache. For a push, this later gets turned into PushDelta
.
Fields§
§inodes: HashSet<Position<Hash>>
§to_download: Vec<CS>
§remote_ref: Option<RemoteRef<T>>
§ours_ge_dichotomy_set: HashSet<CS>
§theirs_ge_dichotomy_set: HashSet<CS>
§theirs_ge_dichotomy: Vec<(u64, Hash, Merkle, bool)>
§remote_unrecs: Vec<(u64, CS)>
Implementations§
Source§impl RemoteDelta<MutTxn<()>>
impl RemoteDelta<MutTxn<()>>
Sourcepub fn to_local_channel_push(
self,
remote_channel: &str,
txn: &mut MutTxn<()>,
path: &[String],
channel: &ChannelRef<MutTxn<()>>,
repo: &Repository,
) -> Result<PushDelta, Error>
pub fn to_local_channel_push( self, remote_channel: &str, txn: &mut MutTxn<()>, path: &[String], channel: &ChannelRef<MutTxn<()>>, repo: &Repository, ) -> Result<PushDelta, Error>
Make a PushDelta
from a RemoteDelta
when the remote is a RemoteRepo::LocalChannel
.
Sourcepub fn to_remote_push(
self,
txn: &mut MutTxn<()>,
path: &[String],
channel: &ChannelRef<MutTxn<()>>,
repo: &Repository,
) -> Result<PushDelta, Error>
pub fn to_remote_push( self, txn: &mut MutTxn<()>, path: &[String], channel: &ChannelRef<MutTxn<()>>, repo: &Repository, ) -> Result<PushDelta, Error>
Make a PushDelta
from a RemoteDelta
when the remote
is not a LocalChannel.