mercurial/scmutil.py
changeset 29996 9766d88c2465
parent 29995 57830bd0e787
child 30109 96a2278ee732
--- a/mercurial/scmutil.py	Thu Sep 22 21:51:57 2016 +0900
+++ b/mercurial/scmutil.py	Thu Sep 22 21:51:57 2016 +0900
@@ -587,6 +587,12 @@
         if nlink == 0:
             self._fixfilemode(f)
 
+        if checkambig:
+            if mode in ('r', 'rb'):
+                raise error.Abort(_('implementation error: mode %s is not'
+                                    ' valid for checkambig=True') % mode)
+            fp = checkambigatclosing(fp)
+
         if backgroundclose:
             if not self._backgroundfilecloser:
                 raise error.Abort(_('backgroundclose can only be used when a '