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, |
|
445 | def decorate(text, fctx): | |
446 |
return ([annotateline(fctx= |
|
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, |
|
449 | def decorate(text, fctx): | |
450 |
return ([annotateline(fctx= |
|
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, |
|
28 | def decorate(text, fctx): | |
29 |
return ([annotateline(fctx= |
|
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