Mercurial > hg-stable
changeset 38034:4e407c7b1fbd
hgweb: rename 'context' argument of webutil.compare() to avoid name conflicts
The meaning of 'context' depends on context. Here it is the number of the
context lines in unified diff.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Wed, 04 Apr 2018 21:14:30 +0900 |
parents | c0ccbf4fbe47 |
children | b3992c21b7f3 |
files | mercurial/hgweb/webutil.py |
diffstat | 1 files changed, 3 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/hgweb/webutil.py Wed Apr 04 00:08:10 2018 +0900 +++ b/mercurial/hgweb/webutil.py Wed Apr 04 21:14:30 2018 +0900 @@ -622,14 +622,14 @@ return templateutil.mappinggenerator(_getcompblockgen, args=args, name='comparisonline') -def compare(tmpl, context, leftlines, rightlines): +def compare(tmpl, contextnum, leftlines, rightlines): '''Generator function that provides side-by-side comparison data.''' s = difflib.SequenceMatcher(None, leftlines, rightlines) - if context < 0: + if contextnum < 0: l = _getcompblock(leftlines, rightlines, s.get_opcodes()) yield tmpl.generate('comparisonblock', {'lines': l}) else: - for oc in s.get_grouped_opcodes(n=context): + for oc in s.get_grouped_opcodes(n=contextnum): l = _getcompblock(leftlines, rightlines, oc) yield tmpl.generate('comparisonblock', {'lines': l})