mercurial@47183: 3 new changesets (3 on stable)

2021-05-24 Thread Mercurial Commits
3 new changesets (3 on stable) in mercurial:

https://www.mercurial-scm.org/repo/hg/rev/6e0af81c43b2
changeset:   47181:6e0af81c43b2
branch:  stable
parent:  47081:e917fa36fb58
user:Matt Harbison 
date:Thu Mar 11 23:20:41 2021 -0500
summary: run-tests: ignore PermissionError when checking available ports

https://www.mercurial-scm.org/repo/hg/rev/dff19fe2973c
changeset:   47182:dff19fe2973c
branch:  stable
user:Matt Harbison 
date:Wed May 05 17:47:30 2021 -0400
summary: run-tests: fix whitelist/blacklist with directories on Windows

https://www.mercurial-scm.org/repo/hg/rev/8be95673eb8a
changeset:   47183:8be95673eb8a
branch:  stable
tag: tip
user:Pierre-Yves David 
date:Fri May 07 10:39:58 2021 +0200
summary: cache: avoid warming the fnodetags cache after clone

-- 
Repository URL: https://www.mercurial-scm.org/repo/hg
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


[Bug 6526] New: hg clone crashes

2021-05-24 Thread mercurial-bugs
https://bz.mercurial-scm.org/show_bug.cgi?id=6526

Bug ID: 6526
   Summary: hg clone crashes
   Product: Mercurial
   Version: 5.2
  Hardware: PC
OS: Linux
Status: UNCONFIRMED
  Severity: feature
  Priority: wish
 Component: Mercurial
  Assignee: bugzi...@mercurial-scm.org
  Reporter: ya...@ieee.org
CC: mercurial-devel@mercurial-scm.org
Python Version: ---

Created attachment 2113
  --> https://bz.mercurial-scm.org/attachment.cgi?id=2113=edit
a1

"hg clone " crashes (see attachment a1.txt). "hg clone --noupdate" does
not crash, but running "hg update default" after "hg clone --noupdate" also
crashes in a similar way. See attachment a2.txt for the result of "hg --debug
update default".

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D10767: rhg: look for repository in ancestors also instead of cwd only

2021-05-24 Thread pulkit (Pulkit Goyal)
pulkit created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  Last patch introduced config reading at startup to parse value of 
`--repository`
  flag. However, that patch only tried to check for current repository at 
current
  working directory and not it's ancestors. This patch fixes that.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D10767

AFFECTED FILES
  rust/hg-core/src/repo.rs
  rust/rhg/src/main.rs

CHANGE DETAILS

diff --git a/rust/rhg/src/main.rs b/rust/rhg/src/main.rs
--- a/rust/rhg/src/main.rs
+++ b/rust/rhg/src/main.rs
@@ -174,8 +174,7 @@
 } else {
 let local_config = {
 if std::env::var_os("HGRCSKIPREPO").is_none() {
-let current_dir = hg::utils::current_dir();
-if let Ok(current_dir_path) = current_dir {
+if let Ok(current_dir_path) = Repo::try_find_repo_root() {
 let config_files = vec![
 ConfigSource::AbsPath(
 current_dir_path.join(".hg/hgrc"),
diff --git a/rust/hg-core/src/repo.rs b/rust/hg-core/src/repo.rs
--- a/rust/hg-core/src/repo.rs
+++ b/rust/hg-core/src/repo.rs
@@ -43,6 +43,22 @@
 }
 
 impl Repo {
+/// tries to find a repository in current working directory and returns its
+/// root path
+pub fn try_find_repo_root() -> Result {
+let current_directory = crate::utils::current_dir()?;
+// ancestors() is inclusive: it first yields `current_directory`
+// as-is.
+for ancestor in current_directory.ancestors() {
+if ancestor.join(".hg").is_dir() {
+return Ok(ancestor.to_path_buf());
+}
+}
+return Err(RepoError::NotFound {
+at: current_directory,
+});
+}
+
 /// Find a repository, either at the given path (which must contain a `.hg`
 /// sub-directory) or by searching the current directory and its
 /// ancestors.
@@ -66,17 +82,12 @@
 })
 }
 } else {
-let current_directory = crate::utils::current_dir()?;
-// ancestors() is inclusive: it first yields `current_directory`
-// as-is.
-for ancestor in current_directory.ancestors() {
-if ancestor.join(".hg").is_dir() {
-return Self::new_at_path(ancestor.to_owned(), config);
-}
+let repo_root = Self::try_find_repo_root();
+if repo_root.is_ok() {
+Self::new_at_path(repo_root.unwrap(), config)
+} else {
+Err(repo_root.unwrap_err())
 }
-Err(RepoError::NotFound {
-at: current_directory,
-})
 }
 }
 



To: pulkit, #hg-reviewers
Cc: mercurial-patches, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel