| @@ -11,10 +11,9 @@ use git_repository::{ · 10 unmodified lines |
| 11 | }; | 11 | }; |
| 12 | | 12 | |
| 13 | use crate::command::changelog_impl::commit; | 13 | use crate::command::changelog_impl::commit; |
| 14 | use crate::command::changelog_impl::commit::History; | | |
| 15 | use crate::utils::{component_to_bytes, is_tag_name, is_tag_version, package_by_name, tag_prefix}; | 14 | use crate::utils::{component_to_bytes, is_tag_name, is_tag_version, package_by_name, tag_prefix}; |
| 16 | | 15 | |
| 17 | pub fn commit_history(repo: &git::Easy) -> anyhow::Result<Option<History>> { | 16 | pub fn commit_history(repo: &git::Easy) -> anyhow::Result<Option<commit::History>> { |
| 18 | let start = Instant::now(); | 17 | let start = Instant::now(); |
| 19 | let prev = repo.object_cache_size(64 * 1024)?; | 18 | let prev = repo.object_cache_size(64 * 1024)?; |
| 20 | let reference = match repo.head()?.peeled()?.kind { | 19 | let reference = match repo.head()?.peeled()?.kind { |
| @@ -32,7 +31,7 @@ pub fn commit_history(repo: &git::Easy) -> anyhow::Result<Option<History>> { · 11 unmodified lines |
| 32 | (commit.message.to_owned(), commit.tree()) | 31 | (commit.message.to_owned(), commit.tree()) |
| 33 | }; | 32 | }; |
| 34 | | 33 | |
| 35 | items.push(commit::HistoryItem { | 34 | items.push(commit::history::Item { |
| 36 | id: commit_id.detach(), | 35 | id: commit_id.detach(), |
| 37 | _message: message, | 36 | _message: message, |
| 38 | tree_data: repo.find_object(tree_id)?.data.to_owned(), | 37 | tree_data: repo.find_object(tree_id)?.data.to_owned(), |
| @@ -47,7 +46,7 @@ pub fn commit_history(repo: &git::Easy) -> anyhow::Result<Option<History>> { · 8 unmodified lines |
| 47 | elapsed.as_secs_f32(), | 46 | elapsed.as_secs_f32(), |
| 48 | items.len() as f32 / elapsed.as_secs_f32() | 47 | items.len() as f32 / elapsed.as_secs_f32() |
| 49 | ); | 48 | ); |
| 50 | Ok(Some(History { | 49 | Ok(Some(commit::History { |
| 51 | head: reference.detach(), | 50 | head: reference.detach(), |
| 52 | items, | 51 | items, |
| 53 | })) | 52 | })) |
| @@ -57,8 +56,8 @@ pub fn commit_history(repo: &git::Easy) -> anyhow::Result<Option<History>> { · 3 unmodified lines |
| 57 | pub fn ref_segments<'h>( | 56 | pub fn ref_segments<'h>( |
| 58 | crate_name: &str, | 57 | crate_name: &str, |
| 59 | ctx: &crate::Context, | 58 | ctx: &crate::Context, |
| 60 | history: &'h History, | 59 | history: &'h commit::History, |
| 61 | ) -> anyhow::Result<Vec<commit::HistorySegment<'h>>> { | 60 | ) -> anyhow::Result<Vec<commit::history::Segment<'h>>> { |
| 62 | let meta = &ctx.meta; | 61 | let meta = &ctx.meta; |
| 63 | let package = package_by_name(meta, crate_name)?; | 62 | let package = package_by_name(meta, crate_name)?; |
| 64 | let tag_prefix = tag_prefix(package, &ctx.repo); | 63 | let tag_prefix = tag_prefix(package, &ctx.repo); |
| @@ -100,7 +99,7 @@ pub fn ref_segments<'h>( · 35 unmodified lines |
| 100 | | 99 | |
| 101 | let start = Instant::now(); | 100 | let start = Instant::now(); |
| 102 | let mut segments = Vec::new(); | 101 | let mut segments = Vec::new(); |
| 103 | let mut segment = commit::HistorySegment { | 102 | let mut segment = commit::history::Segment { |
| 104 | _head: history.head.to_owned(), | 103 | _head: history.head.to_owned(), |
| 105 | history: vec![], | 104 | history: vec![], |
| 106 | }; | 105 | }; |
| @@ -181,7 +180,7 @@ pub fn ref_segments<'h>( · 74 unmodified lines |
| 181 | }, | 180 | }, |
| 182 | Some(next_ref) => segments.push(std::mem::replace( | 181 | Some(next_ref) => segments.push(std::mem::replace( |
| 183 | &mut segment, | 182 | &mut segment, |
| 184 | commit::HistorySegment { | 183 | commit::history::Segment { |
| 185 | _head: next_ref, | 184 | _head: next_ref, |
| 186 | history: vec![item], | 185 | history: vec![item], |
| 187 | }, | 186 | }, |