##// END OF EJS Templates
annotate: correct parameter name of decorate() function
Yuya Nishihara -
r36953:ec46b0ee default
parent child Browse files
Show More
@@ -442,12 +442,12 b' def annotate(base, parents, linenumber=F'
442 """
442 """
443
443
444 if linenumber:
444 if linenumber:
445 def decorate(text, rev):
445 def decorate(text, fctx):
446 return ([annotateline(fctx=rev, lineno=i)
446 return ([annotateline(fctx=fctx, lineno=i)
447 for i in xrange(1, _countlines(text) + 1)], text)
447 for i in xrange(1, _countlines(text) + 1)], text)
448 else:
448 else:
449 def decorate(text, rev):
449 def decorate(text, fctx):
450 return ([annotateline(fctx=rev)] * _countlines(text), text)
450 return ([annotateline(fctx=fctx)] * _countlines(text), text)
451
451
452 # This algorithm would prefer to be recursive, but Python is a
452 # This algorithm would prefer to be recursive, but Python is a
453 # bit recursion-hostile. Instead we do an iterative
453 # bit recursion-hostile. Instead we do an iterative
@@ -25,8 +25,8 b' class AnnotateTests(unittest.TestCase):'
25 childdata = b'a\nb2\nc\nc2\nd\n'
25 childdata = b'a\nb2\nc\nc2\nd\n'
26 diffopts = mdiff.diffopts()
26 diffopts = mdiff.diffopts()
27
27
28 def decorate(text, rev):
28 def decorate(text, fctx):
29 return ([annotateline(fctx=rev, lineno=i)
29 return ([annotateline(fctx=fctx, lineno=i)
30 for i in range(1, text.count(b'\n') + 1)],
30 for i in range(1, text.count(b'\n') + 1)],
31 text)
31 text)
32
32
General Comments 0
You need to be logged in to leave comments. Login now