eol: fix crash when handling removed files

ci --amend would in some cases fail after 2eef89bfd70d failed to refactor the
eol extension too.
This commit is contained in:
Mads Kiilerich 2014-10-22 16:10:23 +02:00
parent ad1ec3399d
commit a195867192
2 changed files with 18 additions and 3 deletions

View File

@ -333,10 +333,10 @@ def reposetup(ui, repo):
for f in sorted(ctx.added() + ctx.modified()):
if not self._eolfile(f):
continue
try:
data = ctx[f].data()
except IOError:
fctx = ctx[f]
if fctx is None:
continue
data = fctx.data()
if util.binary(data):
# We should not abort here, since the user should
# be able to say "** = native" to automatically

View File

@ -525,4 +525,19 @@ append a line without trailing newline
fourth
fifth
amend of changesets with renamed/deleted files expose new code paths
$ hg mv a.txt b.txt
$ hg ci --amend -q
$ hg diff -c.
diff --git a/a.txt b/b.txt
rename from a.txt
rename to b.txt
--- a/a.txt
+++ b/b.txt
@@ -1,2 +1,3 @@
third
fourth
+fifth
$ cd ..