Patchwork [2,of,2,STABLE] eol: fix 'error' parameter name in the commitctx wrapper

login
register
mail settings
Submitter Pierre-Yves David
Date June 23, 2017, 11:28 a.m.
Message ID <9fdb224b2e018cf9be70.1498217312@nodosa.octopoid.net>
Download mbox | patch
Permalink /patch/21628/
State Accepted
Headers show

Comments

Pierre-Yves David - June 23, 2017, 11:28 a.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@octobus.net>
# Date 1498216924 -7200
#      Fri Jun 23 13:22:04 2017 +0200
# Branch stable
# Node ID 9fdb224b2e018cf9be7005596a52fcf60736bc4c
# Parent  c5e43ff544782b1bbd1337ffa1b1802e6144df81
# EXP-Topic eolfix
# Available At https://www.mercurial-scm.org/repo/users/marmoute/mercurial/
#              hg pull https://www.mercurial-scm.org/repo/users/marmoute/mercurial/ -r 9fdb224b2e01
eol: fix 'error' parameter name in the commitctx wrapper

Since its introduction in 9dfee83c93c8, the parameter has always been name
"error". Yet the eol extension have been using 'haserror' as the argument name,
breaking extensions with subclass passing 'error' as a keyword argument.

Patch

diff --git a/hgext/eol.py b/hgext/eol.py
--- a/hgext/eol.py
+++ b/hgext/eol.py
@@ -367,7 +367,7 @@  def reposetup(ui, repo):
                     if wlock is not None:
                         wlock.release()
 
-        def commitctx(self, ctx, haserror=False):
+        def commitctx(self, ctx, error=False):
             for f in sorted(ctx.added() + ctx.modified()):
                 if not self._eolmatch(f):
                     continue
@@ -383,6 +383,6 @@  def reposetup(ui, repo):
                 if inconsistenteol(data):
                     raise errormod.Abort(_("inconsistent newline style "
                                        "in %s\n") % f)
-            return super(eolrepo, self).commitctx(ctx, haserror)
+            return super(eolrepo, self).commitctx(ctx, error)
     repo.__class__ = eolrepo
     repo._hgcleardirstate()