rust/hg-core/src/dirstate.rs
changeset 47343 ed1583a845d2
parent 47340 4ee9f419c52e
child 47380 bd88b6bfd8da
equal deleted inserted replaced
47342:18b3060fe598 47343:ed1583a845d2
     3 // Copyright 2019 Raphaël Gomès <rgomes@octobus.net>
     3 // Copyright 2019 Raphaël Gomès <rgomes@octobus.net>
     4 //
     4 //
     5 // This software may be used and distributed according to the terms of the
     5 // This software may be used and distributed according to the terms of the
     6 // GNU General Public License version 2 or any later version.
     6 // GNU General Public License version 2 or any later version.
     7 
     7 
       
     8 use crate::dirstate_tree::on_disk::DirstateV2ParseError;
     8 use crate::errors::HgError;
     9 use crate::errors::HgError;
     9 use crate::revlog::Node;
    10 use crate::revlog::Node;
    10 use crate::utils::hg_path::{HgPath, HgPathBuf};
    11 use crate::utils::hg_path::{HgPath, HgPathBuf};
    11 use crate::FastHashMap;
    12 use crate::FastHashMap;
    12 use bytes_cast::{unaligned, BytesCast};
    13 use bytes_cast::{unaligned, BytesCast};
    74 /// other parent. This allows revert to pick the right status back during a
    75 /// other parent. This allows revert to pick the right status back during a
    75 /// merge.
    76 /// merge.
    76 pub const SIZE_FROM_OTHER_PARENT: i32 = -2;
    77 pub const SIZE_FROM_OTHER_PARENT: i32 = -2;
    77 
    78 
    78 pub type StateMap = FastHashMap<HgPathBuf, DirstateEntry>;
    79 pub type StateMap = FastHashMap<HgPathBuf, DirstateEntry>;
    79 pub type StateMapIter<'a> =
    80 pub type StateMapIter<'a> = Box<
    80     Box<dyn Iterator<Item = (&'a HgPath, DirstateEntry)> + Send + 'a>;
    81     dyn Iterator<
       
    82             Item = Result<(&'a HgPath, DirstateEntry), DirstateV2ParseError>,
       
    83         > + Send
       
    84         + 'a,
       
    85 >;
    81 
    86 
    82 pub type CopyMap = FastHashMap<HgPathBuf, HgPathBuf>;
    87 pub type CopyMap = FastHashMap<HgPathBuf, HgPathBuf>;
    83 pub type CopyMapIter<'a> =
    88 pub type CopyMapIter<'a> = Box<
    84     Box<dyn Iterator<Item = (&'a HgPath, &'a HgPath)> + Send + 'a>;
    89     dyn Iterator<Item = Result<(&'a HgPath, &'a HgPath), DirstateV2ParseError>>
       
    90         + Send
       
    91         + 'a,
       
    92 >;
    85 
    93 
    86 #[derive(Copy, Clone, Debug, Eq, PartialEq)]
    94 #[derive(Copy, Clone, Debug, Eq, PartialEq)]
    87 pub enum EntryState {
    95 pub enum EntryState {
    88     Normal,
    96     Normal,
    89     Added,
    97     Added,