// `create` does the following, in order:
//
// 1. Creates test directories,
// 2. Creates bare Git repositories with the specified commit history for each
//    dependency in `deps`,
// 3. Stores the commit hashes for each of the repositories created in the
//    previous step, and
// 4. Writes a new dependency file with the commits specified in
//    `deps_commit_nums`.
`create` does the following, in order:
1. Creates test directories,
2. Creates bare Git repositories with the specified commit history for each
dependency in `deps`,
3. Stores the commit hashes for each of the repositories created in the
previous step, and
4. Writes a new dependency file with the commits specified in
`deps_commit_nums`.
` create ` does the following in order : 1 . Creates test directories 2 . Creates bare Git repositories with the specified commit history for each dependency in ` deps ` 3 . Stores the commit hashes for each of the repositories created in the previous step and 4 . Writes a new dependency file with the commits specified in ` deps_commit_nums ` .
pub fn create(
    root_test_dir_name: &str,
    deps: &HashMap<&str, Vec<HashMap<&str, &str>>>,
    deps_commit_nums: &HashMap<&str, usize>,
)
    -> Layout
{
    let root_dir = create_root_dir(root_test_dir_name);
    let dep_srcs_dir = create_dir(root_dir.clone(), "deps");
    let scratch_dir = create_dir(root_dir.clone(), "scratch");
    let proj_dir = create_dir(root_dir, "proj");
    create_dep_srcs(&dep_srcs_dir, &scratch_dir, deps);
    let mut deps_commit_hashes = hashmap!{};
    for dep_src_name in deps.keys() {
        deps_commit_hashes.insert(
            (*dep_src_name).to_string(),
            get_repo_hashes(&format!("{}/{}.git", dep_srcs_dir, dep_src_name)),
        );
    }
    let deps_file = format!("{}/dpnd.txt", proj_dir);
    let deps_file_conts = write_test_deps_file(
        &deps_file,
        &deps_commit_hashes,
        deps_commit_nums,
    );
    Layout{
        dep_srcs_dir,
        proj_dir,
        deps_commit_hashes,
        deps_file,
        deps_file_conts,
    }
}
pub fn create ( root_test_dir_name : & str , deps : & HashMap < & str , Vec < HashMap < & str , & str > > > , deps_commit_nums : & HashMap < & str , usize > , ) -> Layout { let root_dir = create_root_dir ( root_test_dir_name ) ; let dep_srcs_dir = create_dir ( root_dir . clone ( ) , " " ) ; let scratch_dir = create_dir ( root_dir . clone ( ) , " " ) ; let proj_dir = create_dir ( root_dir , " " ) ; create_dep_srcs ( & dep_srcs_dir , & scratch_dir , deps ) ; let mut deps_commit_hashes = hashmap ! { } ; for dep_src_name in deps . keys ( ) { deps_commit_hashes . insert ( ( * dep_src_name ) . to_string ( ) , get_repo_hashes ( & format ! ( " " dep_srcs_dir dep_src_name ) ) , ) ; } let deps_file = format ! ( " " proj_dir ) ; let deps_file_conts = write_test_deps_file ( & deps_file , & deps_commit_hashes , deps_commit_nums , ) ; Layout { dep_srcs_dir , proj_dir , deps_commit_hashes , deps_file , deps_file_conts , } }
`create` does the following, in order:
1.
` create ` does the following in order : 1 .
root_test_dir_name
&str
deps
&HashMap<&str, Vec<HashMap<&str, &str>>>
deps_commit_nums
&HashMap<&str, usize>