Mercurial > hg
annotate mercurial/hgweb.py @ 377:e5d769afd3ef
Merge with TAH
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Merge with TAH
manifest hash: f73215065ecbcfd9a0d0964de5ed73a392837a56
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)
iD8DBQFCsQqNywK+sNU5EO8RAiuOAJ4lL23LcxAkbPHy33snasBgrkhNxQCgkBLO
ohB0/EA2dAvQtu5sMSW03D8=
=lF8D
-----END PGP SIGNATURE-----
author | mpm@selenic.com |
---|---|
date | Wed, 15 Jun 2005 21:13:49 -0800 |
parents | b29219389b00 fadc9e126369 |
children | 5f65a108a559 |
rev | line source |
---|---|
238
3b92f8fe47ae
hgweb.py: kill #! line, clean up copyright notice
mpm@selenic.com
parents:
222
diff
changeset
|
1 # hgweb.py - web interface to a mercurial repository |
131 | 2 # |
238
3b92f8fe47ae
hgweb.py: kill #! line, clean up copyright notice
mpm@selenic.com
parents:
222
diff
changeset
|
3 # Copyright 21 May 2005 - (c) 2005 Jake Edge <jake@edge2.net> |
3b92f8fe47ae
hgweb.py: kill #! line, clean up copyright notice
mpm@selenic.com
parents:
222
diff
changeset
|
4 # Copyright 2005 Matt Mackall <mpm@selenic.com> |
131 | 5 # |
6 # This software may be used and distributed according to the terms | |
7 # of the GNU General Public License, incorporated herein by reference. | |
8 | |
9 # useful for debugging | |
10 import cgitb | |
11 cgitb.enable() | |
12 | |
13 import os, cgi, time, re, difflib, sys, zlib | |
138 | 14 from mercurial.hg import * |
215 | 15 from mercurial.ui import * |
138 | 16 |
157
2653740d8118
Install the templates where they can be found by hgweb.py
mpm@selenic.com
parents:
156
diff
changeset
|
17 def templatepath(): |
201
f918a6fa2572
hgweb: add template filters, template style maps, and raw pages
mpm@selenic.com
parents:
198
diff
changeset
|
18 for f in "templates", "../templates": |
157
2653740d8118
Install the templates where they can be found by hgweb.py
mpm@selenic.com
parents:
156
diff
changeset
|
19 p = os.path.join(os.path.dirname(__file__), f) |
201
f918a6fa2572
hgweb: add template filters, template style maps, and raw pages
mpm@selenic.com
parents:
198
diff
changeset
|
20 if os.path.isdir(p): return p |
157
2653740d8118
Install the templates where they can be found by hgweb.py
mpm@selenic.com
parents:
156
diff
changeset
|
21 |
138 | 22 def age(t): |
23 def plural(t, c): | |
24 if c == 1: return t | |
25 return t + "s" | |
26 def fmt(t, c): | |
27 return "%d %s" % (c, plural(t, c)) | |
28 | |
29 now = time.time() | |
30 delta = max(1, int(now - t)) | |
31 | |
32 scales = [["second", 1], | |
33 ["minute", 60], | |
34 ["hour", 3600], | |
35 ["day", 3600 * 24], | |
36 ["week", 3600 * 24 * 7], | |
37 ["month", 3600 * 24 * 30], | |
38 ["year", 3600 * 24 * 365]] | |
39 | |
40 scales.reverse() | |
41 | |
42 for t, s in scales: | |
43 n = delta / s | |
195 | 44 if n >= 2 or s == 1: return fmt(t, n) |
131 | 45 |
46 def nl2br(text): | |
201
f918a6fa2572
hgweb: add template filters, template style maps, and raw pages
mpm@selenic.com
parents:
198
diff
changeset
|
47 return text.replace('\n', '<br/>\n') |
131 | 48 |
49 def obfuscate(text): | |
138 | 50 return ''.join([ '&#%d' % ord(c) for c in text ]) |
51 | |
52 def up(p): | |
53 if p[0] != "/": p = "/" + p | |
54 if p[-1] == "/": p = p[:-1] | |
55 up = os.path.dirname(p) | |
56 if up == "/": | |
57 return "/" | |
58 return up + "/" | |
131 | 59 |
60 def httphdr(type): | |
61 print 'Content-type: %s\n' % type | |
62 | |
135 | 63 def write(*things): |
64 for thing in things: | |
65 if hasattr(thing, "__iter__"): | |
66 for part in thing: | |
67 write(part) | |
68 else: | |
69 sys.stdout.write(str(thing)) | |
70 | |
201
f918a6fa2572
hgweb: add template filters, template style maps, and raw pages
mpm@selenic.com
parents:
198
diff
changeset
|
71 def template(tmpl, filters = {}, **map): |
138 | 72 while tmpl: |
201
f918a6fa2572
hgweb: add template filters, template style maps, and raw pages
mpm@selenic.com
parents:
198
diff
changeset
|
73 m = re.search(r"#([a-zA-Z0-9]+)((\|[a-zA-Z0-9]+)*)#", tmpl) |
138 | 74 if m: |
75 yield tmpl[:m.start(0)] | |
76 v = map.get(m.group(1), "") | |
201
f918a6fa2572
hgweb: add template filters, template style maps, and raw pages
mpm@selenic.com
parents:
198
diff
changeset
|
77 v = callable(v) and v() or v |
f918a6fa2572
hgweb: add template filters, template style maps, and raw pages
mpm@selenic.com
parents:
198
diff
changeset
|
78 |
f918a6fa2572
hgweb: add template filters, template style maps, and raw pages
mpm@selenic.com
parents:
198
diff
changeset
|
79 fl = m.group(2) |
f918a6fa2572
hgweb: add template filters, template style maps, and raw pages
mpm@selenic.com
parents:
198
diff
changeset
|
80 if fl: |
f918a6fa2572
hgweb: add template filters, template style maps, and raw pages
mpm@selenic.com
parents:
198
diff
changeset
|
81 for f in fl.split("|")[1:]: |
f918a6fa2572
hgweb: add template filters, template style maps, and raw pages
mpm@selenic.com
parents:
198
diff
changeset
|
82 v = filters[f](v) |
f918a6fa2572
hgweb: add template filters, template style maps, and raw pages
mpm@selenic.com
parents:
198
diff
changeset
|
83 |
f918a6fa2572
hgweb: add template filters, template style maps, and raw pages
mpm@selenic.com
parents:
198
diff
changeset
|
84 yield v |
138 | 85 tmpl = tmpl[m.end(0):] |
86 else: | |
87 yield tmpl | |
88 return | |
89 | |
90 class templater: | |
201
f918a6fa2572
hgweb: add template filters, template style maps, and raw pages
mpm@selenic.com
parents:
198
diff
changeset
|
91 def __init__(self, mapfile, filters = {}): |
138 | 92 self.cache = {} |
93 self.map = {} | |
94 self.base = os.path.dirname(mapfile) | |
201
f918a6fa2572
hgweb: add template filters, template style maps, and raw pages
mpm@selenic.com
parents:
198
diff
changeset
|
95 self.filters = filters |
138 | 96 |
97 for l in file(mapfile): | |
98 m = re.match(r'(\S+)\s*=\s*"(.*)"$', l) | |
133
fb84d3e71042
added template support for some hgweb output, also, template files for
jake@edge2.net
parents:
132
diff
changeset
|
99 if m: |
138 | 100 self.cache[m.group(1)] = m.group(2) |
101 else: | |
102 m = re.match(r'(\S+)\s*=\s*(\S+)', l) | |
103 if m: | |
104 self.map[m.group(1)] = os.path.join(self.base, m.group(2)) | |
133
fb84d3e71042
added template support for some hgweb output, also, template files for
jake@edge2.net
parents:
132
diff
changeset
|
105 else: |
138 | 106 raise "unknown map entry '%s'" % l |
133
fb84d3e71042
added template support for some hgweb output, also, template files for
jake@edge2.net
parents:
132
diff
changeset
|
107 |
138 | 108 def __call__(self, t, **map): |
109 try: | |
110 tmpl = self.cache[t] | |
111 except KeyError: | |
112 tmpl = self.cache[t] = file(self.map[t]).read() | |
201
f918a6fa2572
hgweb: add template filters, template style maps, and raw pages
mpm@selenic.com
parents:
198
diff
changeset
|
113 return template(tmpl, self.filters, **map) |
138 | 114 |
115 class hgweb: | |
269
24e9e140485f
hgweb: shrink the default changelog list to 10
mpm@selenic.com
parents:
265
diff
changeset
|
116 maxchanges = 10 |
138 | 117 maxfiles = 10 |
133
fb84d3e71042
added template support for some hgweb output, also, template files for
jake@edge2.net
parents:
132
diff
changeset
|
118 |
201
f918a6fa2572
hgweb: add template filters, template style maps, and raw pages
mpm@selenic.com
parents:
198
diff
changeset
|
119 def __init__(self, path, name, templates = ""): |
f918a6fa2572
hgweb: add template filters, template style maps, and raw pages
mpm@selenic.com
parents:
198
diff
changeset
|
120 self.templates = templates or templatepath() |
138 | 121 self.reponame = name |
258 | 122 self.path = path |
123 self.mtime = -1 | |
197 | 124 self.viewonly = 0 |
131 | 125 |
201
f918a6fa2572
hgweb: add template filters, template style maps, and raw pages
mpm@selenic.com
parents:
198
diff
changeset
|
126 self.filters = { |
f918a6fa2572
hgweb: add template filters, template style maps, and raw pages
mpm@selenic.com
parents:
198
diff
changeset
|
127 "escape": cgi.escape, |
f918a6fa2572
hgweb: add template filters, template style maps, and raw pages
mpm@selenic.com
parents:
198
diff
changeset
|
128 "age": age, |
f918a6fa2572
hgweb: add template filters, template style maps, and raw pages
mpm@selenic.com
parents:
198
diff
changeset
|
129 "date": (lambda x: time.asctime(time.gmtime(x))), |
f918a6fa2572
hgweb: add template filters, template style maps, and raw pages
mpm@selenic.com
parents:
198
diff
changeset
|
130 "addbreaks": nl2br, |
f918a6fa2572
hgweb: add template filters, template style maps, and raw pages
mpm@selenic.com
parents:
198
diff
changeset
|
131 "obfuscate": obfuscate, |
375 | 132 "short": (lambda x: x[:12]), |
201
f918a6fa2572
hgweb: add template filters, template style maps, and raw pages
mpm@selenic.com
parents:
198
diff
changeset
|
133 "firstline": (lambda x: x.splitlines(1)[0]), |
359 | 134 "permissions": (lambda x: x and "-rwxr-xr-x" or "-rw-r--r--") |
201
f918a6fa2572
hgweb: add template filters, template style maps, and raw pages
mpm@selenic.com
parents:
198
diff
changeset
|
135 } |
f918a6fa2572
hgweb: add template filters, template style maps, and raw pages
mpm@selenic.com
parents:
198
diff
changeset
|
136 |
258 | 137 def refresh(self): |
138 s = os.stat(os.path.join(self.path, ".hg", "00changelog.i")) | |
139 if s.st_mtime != self.mtime: | |
322 | 140 self.mtime = s.st_mtime |
258 | 141 self.repo = repository(ui(), self.path) |
142 | |
138 | 143 def date(self, cs): |
144 return time.asctime(time.gmtime(float(cs[2].split(' ')[0]))) | |
145 | |
146 def listfiles(self, files, mf): | |
147 for f in files[:self.maxfiles]: | |
148 yield self.t("filenodelink", node = hex(mf[f]), file = f) | |
149 if len(files) > self.maxfiles: | |
150 yield self.t("fileellipses") | |
151 | |
152 def listfilediffs(self, files, changeset): | |
153 for f in files[:self.maxfiles]: | |
154 yield self.t("filedifflink", node = hex(changeset), file = f) | |
155 if len(files) > self.maxfiles: | |
156 yield self.t("fileellipses") | |
157 | |
156 | 158 def parent(self, t1, node=nullid, rev=-1, **args): |
142 | 159 if node != hex(nullid): |
156 | 160 yield self.t(t1, node = node, rev = rev, **args) |
142 | 161 |
138 | 162 def diff(self, node1, node2, files): |
163 def filterfiles(list, files): | |
164 l = [ x for x in list if x in files ] | |
165 | |
166 for f in files: | |
167 if f[-1] != os.sep: f += os.sep | |
168 l += [ x for x in list if x.startswith(f) ] | |
169 return l | |
131 | 170 |
172
e9b1147db448
hgweb: alternating colors for multifile diffs
mpm@selenic.com
parents:
168
diff
changeset
|
171 parity = [0] |
e9b1147db448
hgweb: alternating colors for multifile diffs
mpm@selenic.com
parents:
168
diff
changeset
|
172 def diffblock(diff, f, fn): |
e9b1147db448
hgweb: alternating colors for multifile diffs
mpm@selenic.com
parents:
168
diff
changeset
|
173 yield self.t("diffblock", |
e9b1147db448
hgweb: alternating colors for multifile diffs
mpm@selenic.com
parents:
168
diff
changeset
|
174 lines = prettyprintlines(diff), |
e9b1147db448
hgweb: alternating colors for multifile diffs
mpm@selenic.com
parents:
168
diff
changeset
|
175 parity = parity[0], |
e9b1147db448
hgweb: alternating colors for multifile diffs
mpm@selenic.com
parents:
168
diff
changeset
|
176 file = f, |
369
09f24af48b82
hgweb: fix deleted file in changeset key error
mpm@selenic.com
parents:
366
diff
changeset
|
177 filenode = hex(fn or nullid)) |
172
e9b1147db448
hgweb: alternating colors for multifile diffs
mpm@selenic.com
parents:
168
diff
changeset
|
178 parity[0] = 1 - parity[0] |
e9b1147db448
hgweb: alternating colors for multifile diffs
mpm@selenic.com
parents:
168
diff
changeset
|
179 |
e9b1147db448
hgweb: alternating colors for multifile diffs
mpm@selenic.com
parents:
168
diff
changeset
|
180 def prettyprintlines(diff): |
138 | 181 for l in diff.splitlines(1): |
201
f918a6fa2572
hgweb: add template filters, template style maps, and raw pages
mpm@selenic.com
parents:
198
diff
changeset
|
182 if l.startswith('+'): |
f918a6fa2572
hgweb: add template filters, template style maps, and raw pages
mpm@selenic.com
parents:
198
diff
changeset
|
183 yield self.t("difflineplus", line = l) |
f918a6fa2572
hgweb: add template filters, template style maps, and raw pages
mpm@selenic.com
parents:
198
diff
changeset
|
184 elif l.startswith('-'): |
f918a6fa2572
hgweb: add template filters, template style maps, and raw pages
mpm@selenic.com
parents:
198
diff
changeset
|
185 yield self.t("difflineminus", line = l) |
f918a6fa2572
hgweb: add template filters, template style maps, and raw pages
mpm@selenic.com
parents:
198
diff
changeset
|
186 elif l.startswith('@'): |
f918a6fa2572
hgweb: add template filters, template style maps, and raw pages
mpm@selenic.com
parents:
198
diff
changeset
|
187 yield self.t("difflineat", line = l) |
138 | 188 else: |
201
f918a6fa2572
hgweb: add template filters, template style maps, and raw pages
mpm@selenic.com
parents:
198
diff
changeset
|
189 yield self.t("diffline", line = l) |
131 | 190 |
138 | 191 r = self.repo |
192 cl = r.changelog | |
193 mf = r.manifest | |
194 change1 = cl.read(node1) | |
195 change2 = cl.read(node2) | |
196 mmap1 = mf.read(change1[0]) | |
197 mmap2 = mf.read(change2[0]) | |
198 date1 = self.date(change1) | |
199 date2 = self.date(change2) | |
131 | 200 |
138 | 201 c, a, d = r.diffrevs(node1, node2) |
202 c, a, d = map(lambda x: filterfiles(x, files), (c, a, d)) | |
131 | 203 |
138 | 204 for f in c: |
205 to = r.file(f).read(mmap1[f]) | |
206 tn = r.file(f).read(mmap2[f]) | |
172
e9b1147db448
hgweb: alternating colors for multifile diffs
mpm@selenic.com
parents:
168
diff
changeset
|
207 yield diffblock(mdiff.unidiff(to, date1, tn, date2, f), f, tn) |
138 | 208 for f in a: |
265
7ca05593bd30
hgweb: fix non-existent source or destination for diff
mpm@selenic.com
parents:
258
diff
changeset
|
209 to = None |
138 | 210 tn = r.file(f).read(mmap2[f]) |
172
e9b1147db448
hgweb: alternating colors for multifile diffs
mpm@selenic.com
parents:
168
diff
changeset
|
211 yield diffblock(mdiff.unidiff(to, date1, tn, date2, f), f, tn) |
138 | 212 for f in d: |
213 to = r.file(f).read(mmap1[f]) | |
265
7ca05593bd30
hgweb: fix non-existent source or destination for diff
mpm@selenic.com
parents:
258
diff
changeset
|
214 tn = None |
172
e9b1147db448
hgweb: alternating colors for multifile diffs
mpm@selenic.com
parents:
168
diff
changeset
|
215 yield diffblock(mdiff.unidiff(to, date1, tn, date2, f), f, tn) |
131 | 216 |
142 | 217 def header(self): |
218 yield self.t("header", repo = self.reponame) | |
219 | |
220 def footer(self): | |
221 yield self.t("footer", repo = self.reponame) | |
222 | |
180 | 223 def changelog(self, pos): |
138 | 224 def changenav(): |
225 def seq(factor = 1): | |
226 yield 1 * factor | |
173
8da1df932c16
hgweb: make navigation of changesets a bit nicer
mpm@selenic.com
parents:
172
diff
changeset
|
227 yield 3 * factor |
8da1df932c16
hgweb: make navigation of changesets a bit nicer
mpm@selenic.com
parents:
172
diff
changeset
|
228 #yield 5 * factor |
138 | 229 for f in seq(factor * 10): |
230 yield f | |
131 | 231 |
173
8da1df932c16
hgweb: make navigation of changesets a bit nicer
mpm@selenic.com
parents:
172
diff
changeset
|
232 l = [] |
8da1df932c16
hgweb: make navigation of changesets a bit nicer
mpm@selenic.com
parents:
172
diff
changeset
|
233 for f in seq(): |
8da1df932c16
hgweb: make navigation of changesets a bit nicer
mpm@selenic.com
parents:
172
diff
changeset
|
234 if f < self.maxchanges / 2: continue |
8da1df932c16
hgweb: make navigation of changesets a bit nicer
mpm@selenic.com
parents:
172
diff
changeset
|
235 if f > count: break |
8da1df932c16
hgweb: make navigation of changesets a bit nicer
mpm@selenic.com
parents:
172
diff
changeset
|
236 r = "%d" % f |
351 | 237 if pos + f < count: l.append(("+" + r, pos + f)) |
238 if pos - f >= 0: l.insert(0, ("-" + r, pos - f)) | |
173
8da1df932c16
hgweb: make navigation of changesets a bit nicer
mpm@selenic.com
parents:
172
diff
changeset
|
239 |
8da1df932c16
hgweb: make navigation of changesets a bit nicer
mpm@selenic.com
parents:
172
diff
changeset
|
240 yield self.t("naventry", rev = 0, label="(0)") |
138 | 241 |
173
8da1df932c16
hgweb: make navigation of changesets a bit nicer
mpm@selenic.com
parents:
172
diff
changeset
|
242 for label, rev in l: |
8da1df932c16
hgweb: make navigation of changesets a bit nicer
mpm@selenic.com
parents:
172
diff
changeset
|
243 yield self.t("naventry", label = label, rev = rev) |
8da1df932c16
hgweb: make navigation of changesets a bit nicer
mpm@selenic.com
parents:
172
diff
changeset
|
244 |
198
c88ef31fb5c0
hgweb: fix tip so that it doesn't need refreshing
mpm@selenic.com
parents:
197
diff
changeset
|
245 yield self.t("naventry", label="tip") |
131 | 246 |
138 | 247 def changelist(): |
142 | 248 parity = (start - end) & 1 |
138 | 249 cl = self.repo.changelog |
250 l = [] # build a list in forward order for efficiency | |
351 | 251 for i in range(start, end): |
138 | 252 n = cl.node(i) |
253 changes = cl.read(n) | |
254 hn = hex(n) | |
255 p1, p2 = cl.parents(n) | |
256 t = float(changes[2].split(' ')[0]) | |
131 | 257 |
138 | 258 l.insert(0, self.t( |
259 'changelogentry', | |
142 | 260 parity = parity, |
201
f918a6fa2572
hgweb: add template filters, template style maps, and raw pages
mpm@selenic.com
parents:
198
diff
changeset
|
261 author = changes[1], |
142 | 262 parent1 = self.parent("changelogparent", |
263 hex(p1), cl.rev(p1)), | |
264 parent2 = self.parent("changelogparent", | |
265 hex(p2), cl.rev(p2)), | |
138 | 266 p1 = hex(p1), p2 = hex(p2), |
267 p1rev = cl.rev(p1), p2rev = cl.rev(p2), | |
268 manifest = hex(changes[0]), | |
201
f918a6fa2572
hgweb: add template filters, template style maps, and raw pages
mpm@selenic.com
parents:
198
diff
changeset
|
269 desc = changes[4], |
f918a6fa2572
hgweb: add template filters, template style maps, and raw pages
mpm@selenic.com
parents:
198
diff
changeset
|
270 date = t, |
138 | 271 files = self.listfilediffs(changes[3], n), |
272 rev = i, | |
273 node = hn)) | |
142 | 274 parity = 1 - parity |
138 | 275 |
276 yield l | |
131 | 277 |
168 | 278 cl = self.repo.changelog |
279 mf = cl.read(cl.tip())[0] | |
280 count = cl.count() | |
351 | 281 start = max(0, pos - self.maxchanges + 1) |
282 end = min(count, start + self.maxchanges) | |
283 pos = end - 1 | |
138 | 284 |
142 | 285 yield self.t('changelog', |
286 header = self.header(), | |
287 footer = self.footer(), | |
288 repo = self.reponame, | |
289 changenav = changenav, | |
168 | 290 manifest = hex(mf), |
142 | 291 rev = pos, changesets = count, entries = changelist) |
131 | 292 |
138 | 293 def changeset(self, nodeid): |
294 n = bin(nodeid) | |
295 cl = self.repo.changelog | |
296 changes = cl.read(n) | |
297 p1, p2 = cl.parents(n) | |
298 p1rev, p2rev = cl.rev(p1), cl.rev(p2) | |
299 t = float(changes[2].split(' ')[0]) | |
300 | |
133
fb84d3e71042
added template support for some hgweb output, also, template files for
jake@edge2.net
parents:
132
diff
changeset
|
301 files = [] |
138 | 302 mf = self.repo.manifest.read(changes[0]) |
131 | 303 for f in changes[3]: |
138 | 304 files.append(self.t("filenodelink", |
369
09f24af48b82
hgweb: fix deleted file in changeset key error
mpm@selenic.com
parents:
366
diff
changeset
|
305 filenode = hex(mf.get(f, nullid)), file = f)) |
138 | 306 |
307 def diff(): | |
308 yield self.diff(p1, n, changes[3]) | |
131 | 309 |
138 | 310 yield self.t('changeset', |
142 | 311 header = self.header(), |
312 footer = self.footer(), | |
313 repo = self.reponame, | |
138 | 314 diff = diff, |
315 rev = cl.rev(n), | |
316 node = nodeid, | |
142 | 317 parent1 = self.parent("changesetparent", |
318 hex(p1), cl.rev(p1)), | |
319 parent2 = self.parent("changesetparent", | |
320 hex(p2), cl.rev(p2)), | |
138 | 321 p1 = hex(p1), p2 = hex(p2), |
322 p1rev = cl.rev(p1), p2rev = cl.rev(p2), | |
323 manifest = hex(changes[0]), | |
201
f918a6fa2572
hgweb: add template filters, template style maps, and raw pages
mpm@selenic.com
parents:
198
diff
changeset
|
324 author = changes[1], |
f918a6fa2572
hgweb: add template filters, template style maps, and raw pages
mpm@selenic.com
parents:
198
diff
changeset
|
325 desc = changes[4], |
f918a6fa2572
hgweb: add template filters, template style maps, and raw pages
mpm@selenic.com
parents:
198
diff
changeset
|
326 date = t, |
138 | 327 files = files) |
131 | 328 |
138 | 329 def filelog(self, f, filenode): |
330 cl = self.repo.changelog | |
331 fl = self.repo.file(f) | |
332 count = fl.count() | |
333 | |
334 def entries(): | |
335 l = [] | |
142 | 336 parity = (count - 1) & 1 |
337 | |
138 | 338 for i in range(count): |
339 | |
340 n = fl.node(i) | |
341 lr = fl.linkrev(n) | |
342 cn = cl.node(lr) | |
343 cs = cl.read(cl.node(lr)) | |
344 p1, p2 = fl.parents(n) | |
345 t = float(cs[2].split(' ')[0]) | |
133
fb84d3e71042
added template support for some hgweb output, also, template files for
jake@edge2.net
parents:
132
diff
changeset
|
346 |
138 | 347 l.insert(0, self.t("filelogentry", |
142 | 348 parity = parity, |
138 | 349 filenode = hex(n), |
350 filerev = i, | |
351 file = f, | |
352 node = hex(cn), | |
201
f918a6fa2572
hgweb: add template filters, template style maps, and raw pages
mpm@selenic.com
parents:
198
diff
changeset
|
353 author = cs[1], |
f918a6fa2572
hgweb: add template filters, template style maps, and raw pages
mpm@selenic.com
parents:
198
diff
changeset
|
354 date = t, |
f918a6fa2572
hgweb: add template filters, template style maps, and raw pages
mpm@selenic.com
parents:
198
diff
changeset
|
355 desc = cs[4], |
138 | 356 p1 = hex(p1), p2 = hex(p2), |
357 p1rev = fl.rev(p1), p2rev = fl.rev(p2))) | |
142 | 358 parity = 1 - parity |
138 | 359 |
360 yield l | |
361 | |
362 yield self.t("filelog", | |
142 | 363 header = self.header(), |
364 footer = self.footer(), | |
365 repo = self.reponame, | |
138 | 366 file = f, |
367 filenode = filenode, | |
368 entries = entries) | |
131 | 369 |
138 | 370 def filerevision(self, f, node): |
371 fl = self.repo.file(f) | |
372 n = bin(node) | |
201
f918a6fa2572
hgweb: add template filters, template style maps, and raw pages
mpm@selenic.com
parents:
198
diff
changeset
|
373 text = fl.read(n) |
138 | 374 changerev = fl.linkrev(n) |
375 cl = self.repo.changelog | |
376 cn = cl.node(changerev) | |
377 cs = cl.read(cn) | |
378 p1, p2 = fl.parents(n) | |
379 t = float(cs[2].split(' ')[0]) | |
380 mfn = cs[0] | |
142 | 381 |
382 def lines(): | |
383 for l, t in enumerate(text.splitlines(1)): | |
201
f918a6fa2572
hgweb: add template filters, template style maps, and raw pages
mpm@selenic.com
parents:
198
diff
changeset
|
384 yield self.t("fileline", line = t, |
142 | 385 linenumber = "% 6d" % (l + 1), |
386 parity = l & 1) | |
359 | 387 |
138 | 388 yield self.t("filerevision", file = f, |
142 | 389 header = self.header(), |
390 footer = self.footer(), | |
391 repo = self.reponame, | |
138 | 392 filenode = node, |
393 path = up(f), | |
142 | 394 text = lines(), |
138 | 395 rev = changerev, |
396 node = hex(cn), | |
397 manifest = hex(mfn), | |
201
f918a6fa2572
hgweb: add template filters, template style maps, and raw pages
mpm@selenic.com
parents:
198
diff
changeset
|
398 author = cs[1], |
f918a6fa2572
hgweb: add template filters, template style maps, and raw pages
mpm@selenic.com
parents:
198
diff
changeset
|
399 date = t, |
142 | 400 parent1 = self.parent("filerevparent", |
156 | 401 hex(p1), fl.rev(p1), file=f), |
142 | 402 parent2 = self.parent("filerevparent", |
156 | 403 hex(p2), fl.rev(p2), file=f), |
138 | 404 p1 = hex(p1), p2 = hex(p2), |
359 | 405 permissions = self.repo.manifest.readflags(mfn)[f], |
138 | 406 p1rev = fl.rev(p1), p2rev = fl.rev(p2)) |
407 | |
408 def fileannotate(self, f, node): | |
409 bcache = {} | |
410 ncache = {} | |
411 fl = self.repo.file(f) | |
412 n = bin(node) | |
413 changerev = fl.linkrev(n) | |
414 | |
415 cl = self.repo.changelog | |
416 cn = cl.node(changerev) | |
417 cs = cl.read(cn) | |
418 p1, p2 = fl.parents(n) | |
419 t = float(cs[2].split(' ')[0]) | |
420 mfn = cs[0] | |
131 | 421 |
138 | 422 def annotate(): |
142 | 423 parity = 1 |
424 last = None | |
138 | 425 for r, l in fl.annotate(n): |
426 try: | |
427 cnode = ncache[r] | |
428 except KeyError: | |
429 cnode = ncache[r] = self.repo.changelog.node(r) | |
430 | |
431 try: | |
432 name = bcache[r] | |
433 except KeyError: | |
434 cl = self.repo.changelog.read(cnode) | |
435 name = cl[1] | |
436 f = name.find('@') | |
437 if f >= 0: | |
438 name = name[:f] | |
439 bcache[r] = name | |
131 | 440 |
142 | 441 if last != cnode: |
442 parity = 1 - parity | |
443 last = cnode | |
444 | |
138 | 445 yield self.t("annotateline", |
142 | 446 parity = parity, |
138 | 447 node = hex(cnode), |
448 rev = r, | |
449 author = name, | |
450 file = f, | |
201
f918a6fa2572
hgweb: add template filters, template style maps, and raw pages
mpm@selenic.com
parents:
198
diff
changeset
|
451 line = l) |
138 | 452 |
453 yield self.t("fileannotate", | |
142 | 454 header = self.header(), |
455 footer = self.footer(), | |
456 repo = self.reponame, | |
138 | 457 file = f, |
458 filenode = node, | |
459 annotate = annotate, | |
460 path = up(f), | |
461 rev = changerev, | |
462 node = hex(cn), | |
463 manifest = hex(mfn), | |
201
f918a6fa2572
hgweb: add template filters, template style maps, and raw pages
mpm@selenic.com
parents:
198
diff
changeset
|
464 author = cs[1], |
f918a6fa2572
hgweb: add template filters, template style maps, and raw pages
mpm@selenic.com
parents:
198
diff
changeset
|
465 date = t, |
156 | 466 parent1 = self.parent("fileannotateparent", |
467 hex(p1), fl.rev(p1), file=f), | |
468 parent2 = self.parent("fileannotateparent", | |
469 hex(p2), fl.rev(p2), file=f), | |
138 | 470 p1 = hex(p1), p2 = hex(p2), |
359 | 471 permissions = self.repo.manifest.readflags(mfn)[f], |
138 | 472 p1rev = fl.rev(p1), p2rev = fl.rev(p2)) |
136 | 473 |
138 | 474 def manifest(self, mnode, path): |
475 mf = self.repo.manifest.read(bin(mnode)) | |
476 rev = self.repo.manifest.rev(bin(mnode)) | |
477 node = self.repo.changelog.node(rev) | |
359 | 478 mff=self.repo.manifest.readflags(bin(mnode)) |
138 | 479 |
480 files = {} | |
142 | 481 |
138 | 482 p = path[1:] |
483 l = len(p) | |
131 | 484 |
138 | 485 for f,n in mf.items(): |
486 if f[:l] != p: | |
487 continue | |
488 remain = f[l:] | |
489 if "/" in remain: | |
490 short = remain[:remain.find("/") + 1] # bleah | |
142 | 491 files[short] = (f, None) |
138 | 492 else: |
493 short = os.path.basename(remain) | |
494 files[short] = (f, n) | |
131 | 495 |
138 | 496 def filelist(): |
142 | 497 parity = 0 |
138 | 498 fl = files.keys() |
499 fl.sort() | |
500 for f in fl: | |
501 full, fnode = files[f] | |
142 | 502 if fnode: |
503 yield self.t("manifestfileentry", | |
504 file = full, | |
505 manifest = mnode, | |
506 filenode = hex(fnode), | |
507 parity = parity, | |
359 | 508 basename = f, |
509 permissions = mff[full]) | |
142 | 510 else: |
511 yield self.t("manifestdirentry", | |
512 parity = parity, | |
513 path = os.path.join(path, f), | |
514 manifest = mnode, basename = f[:-1]) | |
515 parity = 1 - parity | |
138 | 516 |
517 yield self.t("manifest", | |
142 | 518 header = self.header(), |
519 footer = self.footer(), | |
520 repo = self.reponame, | |
138 | 521 manifest = mnode, |
522 rev = rev, | |
523 node = hex(node), | |
524 path = path, | |
525 up = up(path), | |
142 | 526 entries = filelist) |
131 | 527 |
168 | 528 def tags(self): |
529 cl = self.repo.changelog | |
530 mf = cl.read(cl.tip())[0] | |
531 | |
343 | 532 i = self.repo.tagslist() |
533 i.reverse() | |
168 | 534 |
535 def entries(): | |
536 parity = 0 | |
537 for k,n in i: | |
538 yield self.t("tagentry", | |
539 parity = parity, | |
540 tag = k, | |
541 node = hex(n)) | |
542 parity = 1 - parity | |
543 | |
544 yield self.t("tags", | |
545 header = self.header(), | |
546 footer = self.footer(), | |
547 repo = self.reponame, | |
548 manifest = hex(mf), | |
549 entries = entries) | |
550 | |
138 | 551 def filediff(self, file, changeset): |
552 n = bin(changeset) | |
553 cl = self.repo.changelog | |
554 p1 = cl.parents(n)[0] | |
555 cs = cl.read(n) | |
556 mf = self.repo.manifest.read(cs[0]) | |
557 | |
558 def diff(): | |
559 yield self.diff(p1, n, file) | |
131 | 560 |
138 | 561 yield self.t("filediff", |
142 | 562 header = self.header(), |
563 footer = self.footer(), | |
564 repo = self.reponame, | |
138 | 565 file = file, |
376
fadc9e126369
hgweb: fix deleted file in filediff key error
Thomas Arendsen Hein <thomas@intevation.de>
parents:
369
diff
changeset
|
566 filenode = hex(mf.get(file, nullid)), |
138 | 567 node = changeset, |
568 rev = self.repo.changelog.rev(n), | |
569 p1 = hex(p1), | |
570 p1rev = self.repo.changelog.rev(p1), | |
571 diff = diff) | |
572 | |
573 # add tags to things | |
574 # tags -> list of changesets corresponding to tags | |
575 # find tag, changeset, file | |
131 | 576 |
132 | 577 def run(self): |
258 | 578 self.refresh() |
132 | 579 args = cgi.parse() |
580 | |
201
f918a6fa2572
hgweb: add template filters, template style maps, and raw pages
mpm@selenic.com
parents:
198
diff
changeset
|
581 m = os.path.join(self.templates, "map") |
f918a6fa2572
hgweb: add template filters, template style maps, and raw pages
mpm@selenic.com
parents:
198
diff
changeset
|
582 if args.has_key('style'): |
f918a6fa2572
hgweb: add template filters, template style maps, and raw pages
mpm@selenic.com
parents:
198
diff
changeset
|
583 b = os.path.basename("map-" + args['style'][0]) |
f918a6fa2572
hgweb: add template filters, template style maps, and raw pages
mpm@selenic.com
parents:
198
diff
changeset
|
584 p = os.path.join(self.templates, b) |
f918a6fa2572
hgweb: add template filters, template style maps, and raw pages
mpm@selenic.com
parents:
198
diff
changeset
|
585 if os.path.isfile(p): m = p |
f918a6fa2572
hgweb: add template filters, template style maps, and raw pages
mpm@selenic.com
parents:
198
diff
changeset
|
586 |
f918a6fa2572
hgweb: add template filters, template style maps, and raw pages
mpm@selenic.com
parents:
198
diff
changeset
|
587 self.t = templater(m, self.filters) |
f918a6fa2572
hgweb: add template filters, template style maps, and raw pages
mpm@selenic.com
parents:
198
diff
changeset
|
588 |
138 | 589 if not args.has_key('cmd') or args['cmd'][0] == 'changelog': |
351 | 590 hi = self.repo.changelog.count() - 1 |
153
e8a360cd5a9f
changed pos to rev for changelog cmd, changed & to ;
jake@edge2.net
parents:
142
diff
changeset
|
591 if args.has_key('rev'): |
165 | 592 hi = args['rev'][0] |
166
39624c47060f
hgweb: don't blow up on search for unknown keys
mpm@selenic.com
parents:
165
diff
changeset
|
593 try: |
39624c47060f
hgweb: don't blow up on search for unknown keys
mpm@selenic.com
parents:
165
diff
changeset
|
594 hi = self.repo.changelog.rev(self.repo.lookup(hi)) |
351 | 595 except KeyError: pass |
131 | 596 |
138 | 597 write(self.changelog(hi)) |
132 | 598 |
138 | 599 elif args['cmd'][0] == 'changeset': |
600 write(self.changeset(args['node'][0])) | |
601 | |
602 elif args['cmd'][0] == 'manifest': | |
603 write(self.manifest(args['manifest'][0], args['path'][0])) | |
604 | |
168 | 605 elif args['cmd'][0] == 'tags': |
606 write(self.tags()) | |
607 | |
138 | 608 elif args['cmd'][0] == 'filediff': |
609 write(self.filediff(args['file'][0], args['node'][0])) | |
131 | 610 |
132 | 611 elif args['cmd'][0] == 'file': |
138 | 612 write(self.filerevision(args['file'][0], args['filenode'][0])) |
131 | 613 |
138 | 614 elif args['cmd'][0] == 'annotate': |
615 write(self.fileannotate(args['file'][0], args['filenode'][0])) | |
131 | 616 |
138 | 617 elif args['cmd'][0] == 'filelog': |
618 write(self.filelog(args['file'][0], args['filenode'][0])) | |
136 | 619 |
222 | 620 elif args['cmd'][0] == 'heads': |
621 httphdr("text/plain") | |
622 h = self.repo.heads() | |
623 sys.stdout.write(" ".join(map(hex, h)) + "\n") | |
624 | |
132 | 625 elif args['cmd'][0] == 'branches': |
626 httphdr("text/plain") | |
627 nodes = [] | |
628 if args.has_key('nodes'): | |
138 | 629 nodes = map(bin, args['nodes'][0].split(" ")) |
630 for b in self.repo.branches(nodes): | |
631 sys.stdout.write(" ".join(map(hex, b)) + "\n") | |
131 | 632 |
132 | 633 elif args['cmd'][0] == 'between': |
634 httphdr("text/plain") | |
635 nodes = [] | |
636 if args.has_key('pairs'): | |
138 | 637 pairs = [ map(bin, p.split("-")) |
132 | 638 for p in args['pairs'][0].split(" ") ] |
138 | 639 for b in self.repo.between(pairs): |
640 sys.stdout.write(" ".join(map(hex, b)) + "\n") | |
132 | 641 |
642 elif args['cmd'][0] == 'changegroup': | |
643 httphdr("application/hg-changegroup") | |
644 nodes = [] | |
197 | 645 if self.viewonly: |
646 return | |
647 | |
132 | 648 if args.has_key('roots'): |
138 | 649 nodes = map(bin, args['roots'][0].split(" ")) |
131 | 650 |
132 | 651 z = zlib.compressobj() |
138 | 652 for chunk in self.repo.changegroup(nodes): |
132 | 653 sys.stdout.write(z.compress(chunk)) |
654 | |
655 sys.stdout.write(z.flush()) | |
131 | 656 |
132 | 657 else: |
138 | 658 write(self.t("error")) |
131 | 659 |
158
be7103467d2e
Add 'hg serve' command for stand-alone server
mpm@selenic.com
parents:
157
diff
changeset
|
660 def server(path, name, templates, address, port): |
be7103467d2e
Add 'hg serve' command for stand-alone server
mpm@selenic.com
parents:
157
diff
changeset
|
661 |
be7103467d2e
Add 'hg serve' command for stand-alone server
mpm@selenic.com
parents:
157
diff
changeset
|
662 import BaseHTTPServer |
be7103467d2e
Add 'hg serve' command for stand-alone server
mpm@selenic.com
parents:
157
diff
changeset
|
663 import sys, os |
be7103467d2e
Add 'hg serve' command for stand-alone server
mpm@selenic.com
parents:
157
diff
changeset
|
664 |
be7103467d2e
Add 'hg serve' command for stand-alone server
mpm@selenic.com
parents:
157
diff
changeset
|
665 class hgwebhandler(BaseHTTPServer.BaseHTTPRequestHandler): |
be7103467d2e
Add 'hg serve' command for stand-alone server
mpm@selenic.com
parents:
157
diff
changeset
|
666 def do_POST(self): |
271 | 667 try: |
668 self.do_hgweb() | |
669 except socket.error, inst: | |
670 if inst.args[0] != 32: raise | |
158
be7103467d2e
Add 'hg serve' command for stand-alone server
mpm@selenic.com
parents:
157
diff
changeset
|
671 |
be7103467d2e
Add 'hg serve' command for stand-alone server
mpm@selenic.com
parents:
157
diff
changeset
|
672 def do_GET(self): |
271 | 673 self.do_POST() |
158
be7103467d2e
Add 'hg serve' command for stand-alone server
mpm@selenic.com
parents:
157
diff
changeset
|
674 |
be7103467d2e
Add 'hg serve' command for stand-alone server
mpm@selenic.com
parents:
157
diff
changeset
|
675 def do_hgweb(self): |
be7103467d2e
Add 'hg serve' command for stand-alone server
mpm@selenic.com
parents:
157
diff
changeset
|
676 query = "" |
be7103467d2e
Add 'hg serve' command for stand-alone server
mpm@selenic.com
parents:
157
diff
changeset
|
677 p = self.path.find("?") |
be7103467d2e
Add 'hg serve' command for stand-alone server
mpm@selenic.com
parents:
157
diff
changeset
|
678 if p: |
be7103467d2e
Add 'hg serve' command for stand-alone server
mpm@selenic.com
parents:
157
diff
changeset
|
679 query = self.path[p + 1:] |
be7103467d2e
Add 'hg serve' command for stand-alone server
mpm@selenic.com
parents:
157
diff
changeset
|
680 query = query.replace('+', ' ') |
be7103467d2e
Add 'hg serve' command for stand-alone server
mpm@selenic.com
parents:
157
diff
changeset
|
681 |
be7103467d2e
Add 'hg serve' command for stand-alone server
mpm@selenic.com
parents:
157
diff
changeset
|
682 env = {} |
be7103467d2e
Add 'hg serve' command for stand-alone server
mpm@selenic.com
parents:
157
diff
changeset
|
683 env['GATEWAY_INTERFACE'] = 'CGI/1.1' |
be7103467d2e
Add 'hg serve' command for stand-alone server
mpm@selenic.com
parents:
157
diff
changeset
|
684 env['REQUEST_METHOD'] = self.command |
be7103467d2e
Add 'hg serve' command for stand-alone server
mpm@selenic.com
parents:
157
diff
changeset
|
685 if query: |
be7103467d2e
Add 'hg serve' command for stand-alone server
mpm@selenic.com
parents:
157
diff
changeset
|
686 env['QUERY_STRING'] = query |
be7103467d2e
Add 'hg serve' command for stand-alone server
mpm@selenic.com
parents:
157
diff
changeset
|
687 host = self.address_string() |
be7103467d2e
Add 'hg serve' command for stand-alone server
mpm@selenic.com
parents:
157
diff
changeset
|
688 if host != self.client_address[0]: |
be7103467d2e
Add 'hg serve' command for stand-alone server
mpm@selenic.com
parents:
157
diff
changeset
|
689 env['REMOTE_HOST'] = host |
be7103467d2e
Add 'hg serve' command for stand-alone server
mpm@selenic.com
parents:
157
diff
changeset
|
690 env['REMOTE_ADDR'] = self.client_address[0] |
be7103467d2e
Add 'hg serve' command for stand-alone server
mpm@selenic.com
parents:
157
diff
changeset
|
691 |
be7103467d2e
Add 'hg serve' command for stand-alone server
mpm@selenic.com
parents:
157
diff
changeset
|
692 if self.headers.typeheader is None: |
be7103467d2e
Add 'hg serve' command for stand-alone server
mpm@selenic.com
parents:
157
diff
changeset
|
693 env['CONTENT_TYPE'] = self.headers.type |
be7103467d2e
Add 'hg serve' command for stand-alone server
mpm@selenic.com
parents:
157
diff
changeset
|
694 else: |
be7103467d2e
Add 'hg serve' command for stand-alone server
mpm@selenic.com
parents:
157
diff
changeset
|
695 env['CONTENT_TYPE'] = self.headers.typeheader |
be7103467d2e
Add 'hg serve' command for stand-alone server
mpm@selenic.com
parents:
157
diff
changeset
|
696 length = self.headers.getheader('content-length') |
be7103467d2e
Add 'hg serve' command for stand-alone server
mpm@selenic.com
parents:
157
diff
changeset
|
697 if length: |
be7103467d2e
Add 'hg serve' command for stand-alone server
mpm@selenic.com
parents:
157
diff
changeset
|
698 env['CONTENT_LENGTH'] = length |
be7103467d2e
Add 'hg serve' command for stand-alone server
mpm@selenic.com
parents:
157
diff
changeset
|
699 accept = [] |
be7103467d2e
Add 'hg serve' command for stand-alone server
mpm@selenic.com
parents:
157
diff
changeset
|
700 for line in self.headers.getallmatchingheaders('accept'): |
be7103467d2e
Add 'hg serve' command for stand-alone server
mpm@selenic.com
parents:
157
diff
changeset
|
701 if line[:1] in "\t\n\r ": |
be7103467d2e
Add 'hg serve' command for stand-alone server
mpm@selenic.com
parents:
157
diff
changeset
|
702 accept.append(line.strip()) |
be7103467d2e
Add 'hg serve' command for stand-alone server
mpm@selenic.com
parents:
157
diff
changeset
|
703 else: |
be7103467d2e
Add 'hg serve' command for stand-alone server
mpm@selenic.com
parents:
157
diff
changeset
|
704 accept = accept + line[7:].split(',') |
be7103467d2e
Add 'hg serve' command for stand-alone server
mpm@selenic.com
parents:
157
diff
changeset
|
705 env['HTTP_ACCEPT'] = ','.join(accept) |
be7103467d2e
Add 'hg serve' command for stand-alone server
mpm@selenic.com
parents:
157
diff
changeset
|
706 |
be7103467d2e
Add 'hg serve' command for stand-alone server
mpm@selenic.com
parents:
157
diff
changeset
|
707 os.environ.update(env) |
be7103467d2e
Add 'hg serve' command for stand-alone server
mpm@selenic.com
parents:
157
diff
changeset
|
708 |
be7103467d2e
Add 'hg serve' command for stand-alone server
mpm@selenic.com
parents:
157
diff
changeset
|
709 save = sys.argv, sys.stdin, sys.stdout, sys.stderr |
be7103467d2e
Add 'hg serve' command for stand-alone server
mpm@selenic.com
parents:
157
diff
changeset
|
710 try: |
be7103467d2e
Add 'hg serve' command for stand-alone server
mpm@selenic.com
parents:
157
diff
changeset
|
711 sys.stdin = self.rfile |
be7103467d2e
Add 'hg serve' command for stand-alone server
mpm@selenic.com
parents:
157
diff
changeset
|
712 sys.stdout = self.wfile |
be7103467d2e
Add 'hg serve' command for stand-alone server
mpm@selenic.com
parents:
157
diff
changeset
|
713 sys.argv = ["hgweb.py"] |
be7103467d2e
Add 'hg serve' command for stand-alone server
mpm@selenic.com
parents:
157
diff
changeset
|
714 if '=' not in query: |
be7103467d2e
Add 'hg serve' command for stand-alone server
mpm@selenic.com
parents:
157
diff
changeset
|
715 sys.argv.append(query) |
be7103467d2e
Add 'hg serve' command for stand-alone server
mpm@selenic.com
parents:
157
diff
changeset
|
716 self.send_response(200, "Script output follows") |
be7103467d2e
Add 'hg serve' command for stand-alone server
mpm@selenic.com
parents:
157
diff
changeset
|
717 hg.run() |
be7103467d2e
Add 'hg serve' command for stand-alone server
mpm@selenic.com
parents:
157
diff
changeset
|
718 finally: |
be7103467d2e
Add 'hg serve' command for stand-alone server
mpm@selenic.com
parents:
157
diff
changeset
|
719 sys.argv, sys.stdin, sys.stdout, sys.stderr = save |
be7103467d2e
Add 'hg serve' command for stand-alone server
mpm@selenic.com
parents:
157
diff
changeset
|
720 |
be7103467d2e
Add 'hg serve' command for stand-alone server
mpm@selenic.com
parents:
157
diff
changeset
|
721 hg = hgweb(path, name, templates) |
be7103467d2e
Add 'hg serve' command for stand-alone server
mpm@selenic.com
parents:
157
diff
changeset
|
722 httpd = BaseHTTPServer.HTTPServer((address, port), hgwebhandler) |
be7103467d2e
Add 'hg serve' command for stand-alone server
mpm@selenic.com
parents:
157
diff
changeset
|
723 httpd.serve_forever() |