[PATCH 2 of 4] annotate: correct parameter name of decorate() function
Yuya Nishihara
yuya at tcha.org
Tue Mar 13 09:55:10 EDT 2018
# HG changeset patch
# User Yuya Nishihara <yuya at tcha.org>
# Date 1520854628 -32400
# Mon Mar 12 20:37:08 2018 +0900
# Node ID 95af54712a25c298d5ee63c385f3d498250c1624
# Parent aa35c6d7caef9ef9f48d0c9c831f9492c1421c45
annotate: correct parameter name of decorate() function
diff --git a/mercurial/dagop.py b/mercurial/dagop.py
--- a/mercurial/dagop.py
+++ b/mercurial/dagop.py
@@ -442,12 +442,12 @@ def annotate(base, parents, linenumber=F
"""
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
diff --git a/tests/test-annotate.py b/tests/test-annotate.py
--- a/tests/test-annotate.py
+++ b/tests/test-annotate.py
@@ -25,8 +25,8 @@ class AnnotateTests(unittest.TestCase):
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)
More information about the Mercurial-devel
mailing list