comparison hgext/eol.py @ 26587:56b2bcea2529

error: get Abort from 'error' instead of 'util' The home of 'Abort' is 'error' not 'util' however, a lot of code seems to be confused about that and gives all the credit to 'util' instead of the hardworking 'error'. In a spirit of equity, we break the cycle of injustice and give back to 'error' the respect it deserves. And screw that 'util' poser. For great justice.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Thu, 08 Oct 2015 12:55:45 -0700
parents d51c658d3f04
children f5b6b4e574c1
comparison
equal deleted inserted replaced
26586:d51c658d3f04 26587:56b2bcea2529
245 eols = {'to-lf': 'CRLF', 'to-crlf': 'LF'} 245 eols = {'to-lf': 'CRLF', 'to-crlf': 'LF'}
246 msgs = [] 246 msgs = []
247 for node, target, f in failed: 247 for node, target, f in failed:
248 msgs.append(_(" %s in %s should not have %s line endings") % 248 msgs.append(_(" %s in %s should not have %s line endings") %
249 (f, node, eols[target])) 249 (f, node, eols[target]))
250 raise util.Abort(_("end-of-line check failed:\n") + "\n".join(msgs)) 250 raise error.Abort(_("end-of-line check failed:\n") + "\n".join(msgs))
251 251
252 def checkallhook(ui, repo, node, hooktype, **kwargs): 252 def checkallhook(ui, repo, node, hooktype, **kwargs):
253 """verify that files have expected EOLs""" 253 """verify that files have expected EOLs"""
254 _checkhook(ui, repo, node, False) 254 _checkhook(ui, repo, node, False)
255 255
345 # We should not abort here, since the user should 345 # We should not abort here, since the user should
346 # be able to say "** = native" to automatically 346 # be able to say "** = native" to automatically
347 # have all non-binary files taken care of. 347 # have all non-binary files taken care of.
348 continue 348 continue
349 if inconsistenteol(data): 349 if inconsistenteol(data):
350 raise util.Abort(_("inconsistent newline style " 350 raise error.Abort(_("inconsistent newline style "
351 "in %s\n") % f) 351 "in %s\n") % f)
352 return super(eolrepo, self).commitctx(ctx, haserror) 352 return super(eolrepo, self).commitctx(ctx, haserror)
353 repo.__class__ = eolrepo 353 repo.__class__ = eolrepo
354 repo._hgcleardirstate() 354 repo._hgcleardirstate()