equal
deleted
inserted
replaced
635 pub(super) fn write( |
635 pub(super) fn write( |
636 dirstate_map: &DirstateMap, |
636 dirstate_map: &DirstateMap, |
637 can_append: bool, |
637 can_append: bool, |
638 ) -> Result<(Vec<u8>, TreeMetadata, bool, usize), DirstateError> { |
638 ) -> Result<(Vec<u8>, TreeMetadata, bool, usize), DirstateError> { |
639 let append = can_append && dirstate_map.write_should_append(); |
639 let append = can_append && dirstate_map.write_should_append(); |
|
640 if append { |
|
641 log::trace!("appending to the dirstate data file"); |
|
642 } else { |
|
643 log::trace!("creating new dirstate data file"); |
|
644 } |
640 |
645 |
641 // This ignores the space for paths, and for nodes without an entry. |
646 // This ignores the space for paths, and for nodes without an entry. |
642 // TODO: better estimate? Skip the `Vec` and write to a file directly? |
647 // TODO: better estimate? Skip the `Vec` and write to a file directly? |
643 let size_guess = std::mem::size_of::<Node>() |
648 let size_guess = std::mem::size_of::<Node>() |
644 * dirstate_map.nodes_with_entry_count as usize; |
649 * dirstate_map.nodes_with_entry_count as usize; |