Mercurial > public > mercurial-scm > hg
comparison mercurial/hgweb.py @ 1130:1ad52c7679e1
Longer variable names in hgwebdir: l->repos, v->name, r->path
author | Thomas Arendsen Hein <thomas@intevation.de> |
---|---|
date | Sun, 28 Aug 2005 17:53:37 +0200 |
parents | ee4f60abad93 |
children | a67982e64109 |
comparison
equal
deleted
inserted
replaced
1129:ee4f60abad93 | 1130:1ad52c7679e1 |
---|---|
937 tmpl = templater(m, common_filters, | 937 tmpl = templater(m, common_filters, |
938 {"header": header, "footer": footer}) | 938 {"header": header, "footer": footer}) |
939 | 939 |
940 def entries(**map): | 940 def entries(**map): |
941 parity = 0 | 941 parity = 0 |
942 l = self.cp.items("paths") | 942 repos = self.cp.items("paths") |
943 l.sort() | 943 repos.sort() |
944 for v,r in l: | 944 for name, path in repos: |
945 cp2 = ConfigParser.SafeConfigParser() | 945 cp2 = ConfigParser.SafeConfigParser() |
946 cp2.read(os.path.join(r, ".hg", "hgrc")) | 946 cp2.read(os.path.join(path, ".hg", "hgrc")) |
947 | 947 |
948 def get(sec, val, default): | 948 def get(sec, val, default): |
949 try: | 949 try: |
950 return cp2.get(sec, val) | 950 return cp2.get(sec, val) |
951 except: | 951 except: |
952 return default | 952 return default |
953 | 953 |
954 url = os.environ["REQUEST_URI"] + "/" + v | 954 url = os.environ["REQUEST_URI"] + "/" + name |
955 url = url.replace("//", "/") | 955 url = url.replace("//", "/") |
956 | 956 |
957 yield dict(author=get("web", "author", "unknown"), | 957 yield dict(author=get("web", "author", "unknown"), |
958 name=get("web", "name", v), | 958 name=get("web", "name", name), |
959 url=url, | 959 url=url, |
960 parity=parity, | 960 parity=parity, |
961 shortdesc=get("web", "description", "unknown"), | 961 shortdesc=get("web", "description", "unknown"), |
962 lastupdate=os.stat(os.path.join(r, ".hg", | 962 lastupdate=os.stat(os.path.join(path, ".hg", |
963 "00changelog.d")).st_mtime) | 963 "00changelog.d")).st_mtime) |
964 | 964 |
965 parity = 1 - parity | 965 parity = 1 - parity |
966 | 966 |
967 try: | 967 try: |