Show More
@@ -243,7 +243,7 impl InnerRevlog { | |||||
243 |
|
243 | |||
244 | /// The end of the data chunk for this revision |
|
244 | /// The end of the data chunk for this revision | |
245 | #[inline(always)] |
|
245 | #[inline(always)] | |
246 | pub fn end(&self, rev: Revision) -> usize { |
|
246 | pub fn data_end(&self, rev: Revision) -> usize { | |
247 | self.data_start(rev) + self.data_compressed_length(rev) |
|
247 | self.data_start(rev) + self.data_compressed_length(rev) | |
248 | } |
|
248 | } | |
249 |
|
249 | |||
@@ -661,7 +661,7 impl InnerRevlog { | |||||
661 | target_size: Option<u64>, |
|
661 | target_size: Option<u64>, | |
662 | ) -> Result<Vec<&'a [Revision]>, RevlogError> { |
|
662 | ) -> Result<Vec<&'a [Revision]>, RevlogError> { | |
663 | let mut start_data = self.data_start(revs[0]); |
|
663 | let mut start_data = self.data_start(revs[0]); | |
664 | let end_data = self.end(revs[revs.len() - 1]); |
|
664 | let end_data = self.data_end(revs[revs.len() - 1]); | |
665 | let full_span = end_data - start_data; |
|
665 | let full_span = end_data - start_data; | |
666 |
|
666 | |||
667 | let nothing_to_do = target_size |
|
667 | let nothing_to_do = target_size | |
@@ -678,7 +678,7 impl InnerRevlog { | |||||
678 | let mut chunks = vec![]; |
|
678 | let mut chunks = vec![]; | |
679 |
|
679 | |||
680 | for (idx, rev) in revs.iter().enumerate().skip(1) { |
|
680 | for (idx, rev) in revs.iter().enumerate().skip(1) { | |
681 | let span = self.end(*rev) - start_data; |
|
681 | let span = self.data_end(*rev) - start_data; | |
682 | let is_snapshot = self.is_snapshot(*rev)?; |
|
682 | let is_snapshot = self.is_snapshot(*rev)?; | |
683 | if span <= target_size && is_snapshot { |
|
683 | if span <= target_size && is_snapshot { | |
684 | end_rev_idx = idx + 1; |
|
684 | end_rev_idx = idx + 1; | |
@@ -709,7 +709,7 impl InnerRevlog { | |||||
709 | // Protect against individual chunks larger than the limit |
|
709 | // Protect against individual chunks larger than the limit | |
710 | break; |
|
710 | break; | |
711 | } |
|
711 | } | |
712 | let mut local_end_data = self.end(revs[end_rev_idx - 1]); |
|
712 | let mut local_end_data = self.data_end(revs[end_rev_idx - 1]); | |
713 | let mut span = local_end_data - start_data; |
|
713 | let mut span = local_end_data - start_data; | |
714 | while span > target_size { |
|
714 | while span > target_size { | |
715 | if end_rev_idx - start_rev_idx <= 1 { |
|
715 | if end_rev_idx - start_rev_idx <= 1 { | |
@@ -717,7 +717,7 impl InnerRevlog { | |||||
717 | break; |
|
717 | break; | |
718 | } |
|
718 | } | |
719 | end_rev_idx -= (end_rev_idx - start_rev_idx) / 2; |
|
719 | end_rev_idx -= (end_rev_idx - start_rev_idx) / 2; | |
720 | local_end_data = self.end(revs[end_rev_idx - 1]); |
|
720 | local_end_data = self.data_end(revs[end_rev_idx - 1]); | |
721 | span = local_end_data - start_data; |
|
721 | span = local_end_data - start_data; | |
722 | } |
|
722 | } | |
723 | let chunk = |
|
723 | let chunk = | |
@@ -833,7 +833,7 impl InnerRevlog { | |||||
833 | let data_size = if self.is_empty() { |
|
833 | let data_size = if self.is_empty() { | |
834 | 0 |
|
834 | 0 | |
835 | } else { |
|
835 | } else { | |
836 | self.end(Revision((self.len() - 1) as BaseRevision)) |
|
836 | self.data_end(Revision((self.len() - 1) as BaseRevision)) | |
837 | }; |
|
837 | }; | |
838 | let data_handle = if !self.is_inline() { |
|
838 | let data_handle = if !self.is_inline() { | |
839 | let data_handle = match self.vfs.open_write(&self.data_file) { |
|
839 | let data_handle = match self.vfs.open_write(&self.data_file) { |
General Comments 0
You need to be logged in to leave comments.
Login now