# HG changeset patch # User Augie Fackler # Date 1520186652 18000 # Node ID 250f3168d907d6e0a99976d72ce53af5ec8f6803 # Parent 2442927cdd96be0ed98e1e52310865e1ef3d1474 hgweb: fix up trailing slash detection on Python 3 Fixes a couple of hgweb tests. Differential Revision: https://phab.mercurial-scm.org/D2661 diff -r 2442927cdd96 -r 250f3168d907 contrib/python3-whitelist --- a/contrib/python3-whitelist Sun Mar 04 13:03:22 2018 -0500 +++ b/contrib/python3-whitelist Sun Mar 04 13:04:12 2018 -0500 @@ -130,6 +130,8 @@ test-hghave.t test-hgignore.t test-hgk.t +test-hgweb-bundle.t +test-hgweb-descend-empties.t test-hgweb-removed.t test-histedit-arguments.t test-histedit-base.t diff -r 2442927cdd96 -r 250f3168d907 mercurial/hgweb/webcommands.py --- a/mercurial/hgweb/webcommands.py Sun Mar 04 13:03:22 2018 -0500 +++ b/mercurial/hgweb/webcommands.py Sun Mar 04 13:04:12 2018 -0500 @@ -495,7 +495,7 @@ dirs = {} parity = paritygen(web.stripecount) - if path and path[-1] != "/": + if path and path[-1:] != "/": path += "/" l = len(path) abspath = "/" + path diff -r 2442927cdd96 -r 250f3168d907 mercurial/hgweb/webutil.py --- a/mercurial/hgweb/webutil.py Sun Mar 04 13:03:22 2018 -0500 +++ b/mercurial/hgweb/webutil.py Sun Mar 04 13:04:12 2018 -0500 @@ -38,9 +38,9 @@ ) def up(p): - if p[0] != "/": + if p[0:1] != "/": p = "/" + p - if p[-1] == "/": + if p[-1:] == "/": p = p[:-1] up = os.path.dirname(p) if up == "/":