Skip to content

Commit

Permalink
hg_helper: remove unused make_wsgi_dir function (Bug 1818584) r=zeid
Browse files Browse the repository at this point in the history
Differential Revision: https://phabricator.services.mozilla.com/D170804

--HG--
extra : moz-landing-system : lando
  • Loading branch information
cgsheeh committed Feb 24, 2023
1 parent 32849ef commit f09b3ec
Showing 1 changed file with 0 additions and 29 deletions.
29 changes: 0 additions & 29 deletions hgserver/pash/hg_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,35 +309,6 @@ def run_hg_clone(user_repo_dir, repo_name, source_repo_path):
print("Clone complete.")


def make_wsgi_dir(cname, user_repo_dir):
wsgi_dir = Path("/repo/hg/webroot_wsgi/users") / user_repo_dir
# Create user's webroot_wsgi folder if it doesn't already exist
if not wsgi_dir.is_dir():
wsgi_dir.mkdir()

print("Creating hgweb.config file")
# Create hgweb.config file if it doesn't already exist
hgconfig = wsgi_dir / "hgweb.config"
if not hgconfig.is_file():
with hgconfig.open("w") as f:
f.write("[web]\n")
f.write("baseurl = http://%s/users/%s\n" % (cname, user_repo_dir))
f.write("[paths]\n")
f.write("/ = %s/users/%s/*\n" % (DOC_ROOT, user_repo_dir))

# Create hgweb.wsgi file if it doesn't already exist
hgwsgi = wsgi_dir / "hgweb.wsgi"
if not hgwsgi.is_file():
with hgwsgi.open("w") as f:
hgwsgi.write("#!/usr/bin/env python\n")
hgwsgi.write("config = '%s/hgweb.config'\n" % wsgi_dir)
hgwsgi.write("from mercurial import demandimport; demandimport.enable()\n")
hgwsgi.write("from mercurial.hgweb import hgweb\n")
hgwsgi.write("import os\n")
hgwsgi.write("os.environ['HGENCODING'] = 'UTF-8'\n")
hgwsgi.write("application = hgweb(config)\n")


def fix_user_repo_perms(user, user_repo_dir, repo_name):
print("Fixing permissions, don't interrupt.")
repo_path = DOC_ROOT / "users" / user_repo_dir / repo_name
Expand Down

0 comments on commit f09b3ec

Please sign in to comment.