hgext/convert/git.py
branchstable
changeset 10987 b3af02b1f19f
parent 10986 610f047326b9
child 11134 33010ff1fd6f
--- a/hgext/convert/git.py	Sun Apr 25 22:59:50 2010 +0200
+++ b/hgext/convert/git.py	Sun Apr 25 23:07:46 2010 +0200
@@ -94,6 +94,8 @@
                 self.modecache[(f, h)] = (p and "x") or (s and "l") or ""
                 changes.append((f, h))
             entry = None
+        if fh.close():
+            raise util.Abort(_('cannot read changes in %s') % version)
         return (changes, {})
 
     def getcommit(self, version):
@@ -144,6 +146,8 @@
                 continue
             tag = tag[len(prefix):-3]
             tags[tag] = node
+        if fh.close():
+            raise util.Abort(_('cannot read tags from %s') % self.path)
 
         return tags
 
@@ -156,11 +160,11 @@
                     continue
                 m, f = l[:-1].split("\t")
                 changes.append(f)
-            fh.close()
         else:
             fh = self.gitopen('git diff-tree --name-only --root -r %s "%s^%s" --'
                              % (version, version, i + 1))
             changes = [f.rstrip('\n') for f in fh]
-            fh.close()
+        if fh.close():
+            raise util.Abort(_('cannot read changes in %s') % version)
 
         return changes