comparison mercurial/hgweb/webutil.py @ 36714:250f3168d907

hgweb: fix up trailing slash detection on Python 3 Fixes a couple of hgweb tests. Differential Revision: https://phab.mercurial-scm.org/D2661
author Augie Fackler <augie@google.com>
date Sun, 04 Mar 2018 13:04:12 -0500
parents a2fa51415ddc
children 1a1972b1a1ff
comparison
equal deleted inserted replaced
36713:2442927cdd96 36714:250f3168d907
36 ui as uimod, 36 ui as uimod,
37 util, 37 util,
38 ) 38 )
39 39
40 def up(p): 40 def up(p):
41 if p[0] != "/": 41 if p[0:1] != "/":
42 p = "/" + p 42 p = "/" + p
43 if p[-1] == "/": 43 if p[-1:] == "/":
44 p = p[:-1] 44 p = p[:-1]
45 up = os.path.dirname(p) 45 up = os.path.dirname(p)
46 if up == "/": 46 if up == "/":
47 return "/" 47 return "/"
48 return up + "/" 48 return up + "/"