equal
deleted
inserted
replaced
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() |