comparison mercurial/hgweb.py @ 1022:31dcaf9123ba

Minor hgwebdir tweaks - ignore / for PATH_INFO - fix // in URLs
author mpm@selenic.com
date Wed, 24 Aug 2005 03:32:08 -0700
parents bfe12654764d
children bc806ba72959
comparison
equal deleted inserted replaced
1021:a0ce13606208 1022:31dcaf9123ba
842 try: 842 try:
843 virtual = os.environ["PATH_INFO"] 843 virtual = os.environ["PATH_INFO"]
844 except: 844 except:
845 virtual = "" 845 virtual = ""
846 846
847 if virtual: 847 if virtual[1:]:
848 real = self.cp.get("paths", virtual[1:]) 848 real = self.cp.get("paths", virtual[1:])
849 h = hgweb(real) 849 h = hgweb(real)
850 h.run() 850 h.run()
851 return 851 return
852 852
873 try: 873 try:
874 return cp2.get(sec, val) 874 return cp2.get(sec, val)
875 except: 875 except:
876 return default 876 return default
877 877
878 url = os.environ["REQUEST_URI"] + "/" + v
879 url = url.replace("//", "/")
880
878 yield dict(author = get("web", "author", "unknown"), 881 yield dict(author = get("web", "author", "unknown"),
879 name = get("web", "name", v), 882 name = get("web", "name", v),
880 url = os.environ["REQUEST_URI"] + "/" + v, 883 url = url,
881 parity = parity, 884 parity = parity,
882 shortdesc = get("web", "description", "unknown"), 885 shortdesc = get("web", "description", "unknown"),
883 lastupdate = os.stat(os.path.join(r, ".hg", 886 lastupdate = os.stat(os.path.join(r, ".hg",
884 "00changelog.d")).st_mtime) 887 "00changelog.d")).st_mtime)
885 888