rust/rhg/src/utils/path_utils.rs
changeset 49914 58074252db3c
parent 48453 9b0e1f64656f
equal deleted inserted replaced
49913:c15b415d1bff 49914:58074252db3c
    21     pub fn new(repo: &Repo) -> Result<Self, HgError> {
    21     pub fn new(repo: &Repo) -> Result<Self, HgError> {
    22         let cwd = current_dir()?;
    22         let cwd = current_dir()?;
    23         let repo_root = repo.working_directory_path();
    23         let repo_root = repo.working_directory_path();
    24         let repo_root = cwd.join(repo_root); // Make it absolute
    24         let repo_root = cwd.join(repo_root); // Make it absolute
    25         let repo_root_hgpath =
    25         let repo_root_hgpath =
    26             HgPathBuf::from(get_bytes_from_path(repo_root.to_owned()));
    26             HgPathBuf::from(get_bytes_from_path(&repo_root));
    27 
    27 
    28         if let Ok(cwd_relative_to_repo) = cwd.strip_prefix(&repo_root) {
    28         if let Ok(cwd_relative_to_repo) = cwd.strip_prefix(&repo_root) {
    29             // The current directory is inside the repo, so we can work with
    29             // The current directory is inside the repo, so we can work with
    30             // relative paths
    30             // relative paths
    31             Ok(Self {
    31             Ok(Self {