Patchwork [2,of,4] eol: rename 'error' to 'haserror'

login
register
mail settings
Submitter Pierre-Yves David
Date Oct. 8, 2015, 7:56 p.m.
Message ID <938ed1b297ac735888da.1444334173@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/10891/
State Accepted
Commit d51c658d3f0488419ca0364c96caf34b2fd78f83
Headers show

Comments

Pierre-Yves David - Oct. 8, 2015, 7:56 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@fb.com>
# Date 1444110564 25200
#      Mon Oct 05 22:49:24 2015 -0700
# Node ID 938ed1b297ac735888da73310d2821b3d4219fa5
# Parent  5d09ff6fb1868d1d379b80d9e06765c4af87d2ef
eol: rename 'error' to 'haserror'

The variable 'error' conflict with the module name that we would like to import
and use in a coming changeset.
Yuya Nishihara - Oct. 9, 2015, 3:05 p.m.
On Thu, 08 Oct 2015 12:56:13 -0700, Pierre-Yves David wrote:
> # HG changeset patch
> # User Pierre-Yves David <pierre-yves.david@fb.com>
> # Date 1444110564 25200
> #      Mon Oct 05 22:49:24 2015 -0700
> # Node ID 938ed1b297ac735888da73310d2821b3d4219fa5
> # Parent  5d09ff6fb1868d1d379b80d9e06765c4af87d2ef
> eol: rename 'error' to 'haserror'
> 
> The variable 'error' conflict with the module name that we would like to import
> and use in a coming changeset.
> 
> diff --git a/hgext/eol.py b/hgext/eol.py
> --- a/hgext/eol.py
> +++ b/hgext/eol.py
> @@ -331,11 +331,11 @@ def reposetup(ui, repo):
>                      # as modified. But if we cannot lock the
>                      # repository, then we can also not make a commit,
>                      # so ignore the error.
>                      pass
>  
> -        def commitctx(self, ctx, error=False):
> +        def commitctx(self, ctx, haserror=False):

Perhaps localrepo.commitctx and other wrappers should be updated as well.

Patch

diff --git a/hgext/eol.py b/hgext/eol.py
--- a/hgext/eol.py
+++ b/hgext/eol.py
@@ -331,11 +331,11 @@  def reposetup(ui, repo):
                     # as modified. But if we cannot lock the
                     # repository, then we can also not make a commit,
                     # so ignore the error.
                     pass
 
-        def commitctx(self, ctx, error=False):
+        def commitctx(self, ctx, haserror=False):
             for f in sorted(ctx.added() + ctx.modified()):
                 if not self._eolfile(f):
                     continue
                 fctx = ctx[f]
                 if fctx is None:
@@ -347,8 +347,8 @@  def reposetup(ui, repo):
                     # have all non-binary files taken care of.
                     continue
                 if inconsistenteol(data):
                     raise util.Abort(_("inconsistent newline style "
                                        "in %s\n") % f)
-            return super(eolrepo, self).commitctx(ctx, error)
+            return super(eolrepo, self).commitctx(ctx, haserror)
     repo.__class__ = eolrepo
     repo._hgcleardirstate()