--- a/hgext/eol.py Sun Jun 18 00:40:58 2017 +0900
+++ b/hgext/eol.py Fri Jun 23 15:30:27 2017 -0400
@@ -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()