Mercurial > hg > mercurial-crew-with-dirclash
comparison mercurial/hgweb.py @ 975:bdd7c53fca00
hgweb: Changed changelog page to list format syntax
author | Josef "Jeff" Sipek <jeffpc@optonline.net> |
---|---|
date | Wed, 17 Aug 2005 21:45:44 -0500 |
parents | aedb47764f29 |
children | 5d5ab159d197 |
comparison
equal
deleted
inserted
replaced
974:aedb47764f29 | 975:bdd7c53fca00 |
---|---|
250 if f > count: break | 250 if f > count: break |
251 r = "%d" % f | 251 r = "%d" % f |
252 if pos + f < count: l.append(("+" + r, pos + f)) | 252 if pos + f < count: l.append(("+" + r, pos + f)) |
253 if pos - f >= 0: l.insert(0, ("-" + r, pos - f)) | 253 if pos - f >= 0: l.insert(0, ("-" + r, pos - f)) |
254 | 254 |
255 yield self.t("naventry", rev = 0, label="(0)") | 255 yield {"rev": 0, "label": "(0)"} |
256 | 256 |
257 for label, rev in l: | 257 for label, rev in l: |
258 yield self.t("naventry", label = label, rev = rev) | 258 yield {"label": label, "rev": rev} |
259 | 259 |
260 yield self.t("naventry", label="tip") | 260 yield {"label": "tip", "rev": ""} |
261 | 261 |
262 def changelist(**map): | 262 def changelist(**map): |
263 parity = (start - end) & 1 | 263 parity = (start - end) & 1 |
264 cl = self.repo.changelog | 264 cl = self.repo.changelog |
265 l = [] # build a list in forward order for efficiency | 265 l = [] # build a list in forward order for efficiency |
267 n = cl.node(i) | 267 n = cl.node(i) |
268 changes = cl.read(n) | 268 changes = cl.read(n) |
269 hn = hex(n) | 269 hn = hex(n) |
270 t = float(changes[2].split(' ')[0]) | 270 t = float(changes[2].split(' ')[0]) |
271 | 271 |
272 l.insert(0, self.t( | 272 l.insert(0, { |
273 'changelogentry', | 273 "parity": parity, |
274 parity = parity, | 274 "author": changes[1], |
275 author = changes[1], | 275 "parent": self.parents("changelogparent", |
276 parent = self.parents("changelogparent", | |
277 cl.parents(n), cl.rev), | 276 cl.parents(n), cl.rev), |
278 changelogtag = self.showtag("changelogtag",n), | 277 "changelogtag": self.showtag("changelogtag",n), |
279 manifest = hex(changes[0]), | 278 "manifest": hex(changes[0]), |
280 desc = changes[4], | 279 "desc": changes[4], |
281 date = t, | 280 "date": t, |
282 files = self.listfilediffs(changes[3], n), | 281 "files": self.listfilediffs(changes[3], n), |
283 rev = i, | 282 "rev": i, |
284 node = hn)) | 283 "node": hn}) |
285 parity = 1 - parity | 284 parity = 1 - parity |
286 | 285 |
287 yield l | 286 for e in l: yield e |
288 | 287 |
289 cl = self.repo.changelog | 288 cl = self.repo.changelog |
290 mf = cl.read(cl.tip())[0] | 289 mf = cl.read(cl.tip())[0] |
291 count = cl.count() | 290 count = cl.count() |
292 start = max(0, pos - self.maxchanges + 1) | 291 start = max(0, pos - self.maxchanges + 1) |