Skip to content

Commit

Permalink
pash: limit public repo search to 1-2 levels of depth (Bug 1825810) r…
Browse files Browse the repository at this point in the history
…=jcristau,zeid

The glob pattern `**/.hg` searches all directories recursively causing a
hang in the terminal due to the depth of the filesystem. In reality
we only want to search 1-2 levels deep, so change to using two more
restricted patterns instead.

Differential Revision: https://phabricator.services.mozilla.com/D174307

--HG--
extra : moz-landing-system : lando
  • Loading branch information
cgsheeh committed Apr 4, 2023
1 parent c132f4f commit 7c55a88
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion hgserver/pash/hg_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,9 @@ def make_repo_clone(cname, user, user_repo_dir, repo_name, quick_src):
print("List of available public repos")
repo_list = sorted(
repo_path.parent.relative_to(DOC_ROOT)
for repo_path in DOC_ROOT.glob("**/.hg")
# Search for repos 1-2 levels deep.
for pattern in ("*/.hg", "*/*/.hg")
for repo_path in DOC_ROOT.glob(pattern)
if not is_relative_to(repo_path, USER_REPO_ROOT)
)
source_repo = prompt_user("Pick a source repo:", repo_list, period=False)
Expand Down

0 comments on commit 7c55a88

Please sign in to comment.