changeset 33787:c808862f2e6e

merge with stable
author Augie Fackler <augie@google.com>
date Fri, 23 Jun 2017 15:30:27 -0400
parents f63d111258da (current diff) 4e7352b8325c (diff)
children 9343fce87789
files
diffstat 1 files changed, 8 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/eol.py
+++ b/hgext/eol.py
@@ -98,7 +98,7 @@
 from mercurial.i18n import _
 from mercurial import (
     config,
-    error,
+    error as errormod,
     extensions,
     match,
     pycompat,
@@ -225,7 +225,7 @@
                 return eolfile(ui, repo.root, data)
             except (IOError, LookupError):
                 pass
-    except error.ParseError as inst:
+    except errormod.ParseError as inst:
         ui.warn(_("warning: ignoring .hgeol file due to parse error "
                   "at %s: %s\n") % (inst.args[1], inst.args[0]))
     return None
@@ -254,7 +254,7 @@
         for f, target, node in sorted(failed):
             msgs.append(_("  %s in %s should not have %s line endings") %
                         (f, node, eols[target]))
-        raise error.Abort(_("end-of-line check failed:\n") + "\n".join(msgs))
+        raise errormod.Abort(_("end-of-line check failed:\n") + "\n".join(msgs))
 
 def checkallhook(ui, repo, node, hooktype, **kwargs):
     """verify that files have expected EOLs"""
@@ -356,7 +356,7 @@
                     # Write the cache to update mtime and cache .hgeol
                     with self.vfs("eol.cache", "w") as f:
                         f.write(hgeoldata)
-                except error.LockUnavailable:
+                except errormod.LockUnavailable:
                     # If we cannot lock the repository and clear the
                     # dirstate, then a commit might not see all files
                     # as modified. But if we cannot lock the
@@ -367,7 +367,7 @@
                     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
@@ -381,8 +381,8 @@
                     # have all non-binary files taken care of.
                     continue
                 if inconsistenteol(data):
-                    raise error.Abort(_("inconsistent newline style "
-                                       "in %s\n") % f)
-            return super(eolrepo, self).commitctx(ctx, haserror)
+                    raise errormod.Abort(_("inconsistent newline style "
+                                           "in %s\n") % f)
+            return super(eolrepo, self).commitctx(ctx, error)
     repo.__class__ = eolrepo
     repo._hgcleardirstate()