comparison mercurial/hgweb/hgweb_mod.py @ 3409:1ae738bacf74

Fixed page overlap for file revision links in hgweb. This is another step to fix issue189, but currently the file revision numbers are read as changeset revision numbers, so the link will point to the wrong revision.
author Thomas Arendsen Hein <thomas@intevation.de>
date Mon, 16 Oct 2006 09:53:31 +0200
parents 03e7e8958a27
children 0eba7e76cd02
comparison
equal deleted inserted replaced
3408:4e0c08f019b8 3409:1ae738bacf74
308 def filelog(self, fctx): 308 def filelog(self, fctx):
309 f = fctx.path() 309 f = fctx.path()
310 fl = fctx.filelog() 310 fl = fctx.filelog()
311 count = fl.count() 311 count = fl.count()
312 pagelen = self.maxshortchanges 312 pagelen = self.maxshortchanges
313 pos = fctx.filerev()
314 start = max(0, pos - pagelen + 1)
315 end = min(count, start + pagelen)
316 pos = end - 1
313 317
314 def entries(**map): 318 def entries(**map):
315 pos = fctx.filerev()
316 start = max(0, pos - pagelen + 1)
317 end = min(count, start + pagelen)
318 pos = end - 1
319 l = [] 319 l = []
320 parity = (count - 1) & 1 320 parity = (count - 1) & 1
321 321
322 for i in range(start, end): 322 for i in range(start, end):
323 ctx = fctx.filectx(i) 323 ctx = fctx.filectx(i)
336 parity = 1 - parity 336 parity = 1 - parity
337 337
338 for e in l: 338 for e in l:
339 yield e 339 yield e
340 340
341 nav = revnavgen(fctx.filerev(), self.maxshortchanges, count) 341 nav = revnavgen(pos, pagelen, count)
342 yield self.t("filelog", file=f, node=hex(fctx.node()), nav=nav, 342 yield self.t("filelog", file=f, node=hex(fctx.node()), nav=nav,
343 entries=entries) 343 entries=entries)
344 344
345 def filerevision(self, fctx): 345 def filerevision(self, fctx):
346 f = fctx.path() 346 f = fctx.path()