mirror of
https://github.com/martinvonz/jj.git
synced 2025-01-23 12:52:35 +00:00
Move the old new_change_id
function next to the tests
In the following commit, we replace it everywhere else.
This commit is contained in:
parent
bd234c13c5
commit
44d443a63b
3 changed files with 12 additions and 2 deletions
|
@ -26,6 +26,7 @@ pub struct CommitBuilder<'repo> {
|
|||
rewrite_source: Option<Commit>,
|
||||
}
|
||||
|
||||
// TODO: This function will be replaced in the next commit.
|
||||
pub fn new_change_id() -> ChangeId {
|
||||
ChangeId::from_bytes(Uuid::new_v4().as_bytes())
|
||||
}
|
||||
|
|
|
@ -1620,7 +1620,11 @@ mod tests {
|
|||
use test_case::test_case;
|
||||
|
||||
use super::*;
|
||||
use crate::commit_builder::new_change_id;
|
||||
/// Note that this function produces different ids on subsequent test runs
|
||||
/// TODO: The dependence on the uuid crate is unnecessary.
|
||||
pub fn new_change_id() -> ChangeId {
|
||||
ChangeId::from_bytes(uuid::Uuid::new_v4().as_bytes())
|
||||
}
|
||||
|
||||
#[test_case(false; "memory")]
|
||||
#[test_case(true; "file")]
|
||||
|
|
|
@ -2146,9 +2146,14 @@ fn has_diff_from_parent(repo: RepoRef<'_>, entry: &IndexEntry<'_>, matcher: &dyn
|
|||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use crate::commit_builder::new_change_id;
|
||||
use crate::index::MutableIndex;
|
||||
|
||||
/// Note that this function produces different ids on subsequent test runs
|
||||
/// TODO: The dependence on the uuid crate is unnecessary.
|
||||
pub fn new_change_id() -> crate::backend::ChangeId {
|
||||
crate::backend::ChangeId::from_bytes(uuid::Uuid::new_v4().as_bytes())
|
||||
}
|
||||
|
||||
fn parse(revset_str: &str) -> Result<Rc<RevsetExpression>, RevsetParseErrorKind> {
|
||||
parse_with_aliases(revset_str, [] as [(&str, &str); 0])
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue