annotate: correct parameter name of decorate() function
authorYuya Nishihara <yuya@tcha.org>
Mon, 12 Mar 2018 20:37:08 +0900
changeset 36935 ec46b0ee2e3c
parent 36934 dbae581010ea
child 36936 a2baa61bbb14
annotate: correct parameter name of decorate() function
mercurial/dagop.py
tests/test-annotate.py
--- a/mercurial/dagop.py	Tue Mar 13 21:22:14 2018 +0900
+++ b/mercurial/dagop.py	Mon Mar 12 20:37:08 2018 +0900
@@ -442,12 +442,12 @@
     """
 
     if linenumber:
-        def decorate(text, rev):
-            return ([annotateline(fctx=rev, lineno=i)
+        def decorate(text, fctx):
+            return ([annotateline(fctx=fctx, lineno=i)
                      for i in xrange(1, _countlines(text) + 1)], text)
     else:
-        def decorate(text, rev):
-            return ([annotateline(fctx=rev)] * _countlines(text), text)
+        def decorate(text, fctx):
+            return ([annotateline(fctx=fctx)] * _countlines(text), text)
 
     # This algorithm would prefer to be recursive, but Python is a
     # bit recursion-hostile. Instead we do an iterative
--- a/tests/test-annotate.py	Tue Mar 13 21:22:14 2018 +0900
+++ b/tests/test-annotate.py	Mon Mar 12 20:37:08 2018 +0900
@@ -25,8 +25,8 @@
         childdata = b'a\nb2\nc\nc2\nd\n'
         diffopts = mdiff.diffopts()
 
-        def decorate(text, rev):
-            return ([annotateline(fctx=rev, lineno=i)
+        def decorate(text, fctx):
+            return ([annotateline(fctx=fctx, lineno=i)
                      for i in range(1, text.count(b'\n') + 1)],
                     text)