comparison mercurial/hgweb/webcommands.py @ 7280:810ca383da9c

remove unused variables
author Benoit Boissinot <benoit.boissinot@ens-lyon.org>
date Tue, 28 Oct 2008 19:25:26 +0100
parents 099b4f9be5ab
children 9c399c53469d
comparison
equal deleted inserted replaced
7279:1f0f84660dea 7280:810ca383da9c
57 return [text] 57 return [text]
58 58
59 def _filerevision(web, tmpl, fctx): 59 def _filerevision(web, tmpl, fctx):
60 f = fctx.path() 60 f = fctx.path()
61 text = fctx.data() 61 text = fctx.data()
62 fl = fctx.filelog()
63 n = fctx.filenode()
64 parity = paritygen(web.stripecount) 62 parity = paritygen(web.stripecount)
65 63
66 if binary(text): 64 if binary(text):
67 mt = mimetypes.guess_type(f)[0] or 'application/octet-stream' 65 mt = mimetypes.guess_type(f)[0] or 'application/octet-stream'
68 text = '(binary:%s)' % mt 66 text = '(binary:%s)' % mt
418 416
419 def filediff(web, req, tmpl): 417 def filediff(web, req, tmpl):
420 fctx, ctx = None, None 418 fctx, ctx = None, None
421 try: 419 try:
422 fctx = webutil.filectx(web.repo, req) 420 fctx = webutil.filectx(web.repo, req)
423 except LookupError, inst: 421 except LookupError:
424 ctx = webutil.changectx(web.repo, req) 422 ctx = webutil.changectx(web.repo, req)
425 path = webutil.cleanpath(web.repo, req.form['file'][0]) 423 path = webutil.cleanpath(web.repo, req.form['file'][0])
426 if path not in ctx.files(): 424 if path not in ctx.files():
427 raise 425 raise
428 426
456 diff = filediff 454 diff = filediff
457 455
458 def annotate(web, req, tmpl): 456 def annotate(web, req, tmpl):
459 fctx = webutil.filectx(web.repo, req) 457 fctx = webutil.filectx(web.repo, req)
460 f = fctx.path() 458 f = fctx.path()
461 n = fctx.filenode()
462 fl = fctx.filelog()
463 parity = paritygen(web.stripecount) 459 parity = paritygen(web.stripecount)
464 460
465 def annotate(**map): 461 def annotate(**map):
466 last = None 462 last = None
467 if binary(fctx.data()): 463 if binary(fctx.data()):
518 def entries(limit=0, **map): 514 def entries(limit=0, **map):
519 l = [] 515 l = []
520 516
521 for i in xrange(start, end): 517 for i in xrange(start, end):
522 ctx = fctx.filectx(i) 518 ctx = fctx.filectx(i)
523 n = fl.node(i)
524 519
525 l.insert(0, {"parity": parity.next(), 520 l.insert(0, {"parity": parity.next(),
526 "filerev": i, 521 "filerev": i,
527 "file": f, 522 "file": f,
528 "node": hex(ctx.node()), 523 "node": hex(ctx.node()),