[Updated] D8874: hgweb: simplify staticfile() now that we always pass it a single directory
martinvonz (Martin von Zweigbergk)
phabricator at mercurial-scm.org
Thu Aug 6 00:48:33 UTC 2020
Closed by commit rHG9a5c4875a88c: hgweb: simplify staticfile() now that we always pass it a single directory (authored by martinvonz).
This revision was automatically updated to reflect the committed changes.
REPOSITORY
rHG Mercurial
CHANGES SINCE LAST UPDATE
https://phab.mercurial-scm.org/D8874?vs=22242&id=22287
CHANGES SINCE LAST ACTION
https://phab.mercurial-scm.org/D8874/new/
REVISION DETAIL
https://phab.mercurial-scm.org/D8874
AFFECTED FILES
mercurial/hgweb/common.py
mercurial/hgweb/hgwebdir_mod.py
mercurial/hgweb/webcommands.py
CHANGE DETAILS
diff --git a/mercurial/hgweb/webcommands.py b/mercurial/hgweb/webcommands.py
--- a/mercurial/hgweb/webcommands.py
+++ b/mercurial/hgweb/webcommands.py
@@ -1320,7 +1320,7 @@
static = web.config(b"web", b"static", untrusted=False)
if not static:
tp = web.templatepath or templater.templatedir()
- static = [os.path.join(tp, b'static')]
+ static = os.path.join(tp, b'static')
staticfile(static, fname, web.res)
return web.res.sendresponse()
diff --git a/mercurial/hgweb/hgwebdir_mod.py b/mercurial/hgweb/hgwebdir_mod.py
--- a/mercurial/hgweb/hgwebdir_mod.py
+++ b/mercurial/hgweb/hgwebdir_mod.py
@@ -416,7 +416,7 @@
if not static:
tp = self.templatepath or templater.templatedir()
if tp is not None:
- static = [os.path.join(tp, b'static')]
+ static = os.path.join(tp, b'static')
staticfile(static, fname, res)
return res.sendresponse()
diff --git a/mercurial/hgweb/common.py b/mercurial/hgweb/common.py
--- a/mercurial/hgweb/common.py
+++ b/mercurial/hgweb/common.py
@@ -191,12 +191,7 @@
return
fpath = os.path.join(*fname.split(b'/'))
- if isinstance(directory, bytes):
- directory = [directory]
- for d in directory:
- path = os.path.join(d, fpath)
- if os.path.exists(path):
- break
+ path = os.path.join(directory, fpath)
try:
os.stat(path)
ct = pycompat.sysbytes(
To: martinvonz, #hg-reviewers, indygreg
Cc: mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-patches/attachments/20200806/d526e4ae/attachment-0002.html>
More information about the Mercurial-patches
mailing list