merge with crew-stable
authorBenoit Boissinot <benoit.boissinot@ens-lyon.org>
Fri, 24 Aug 2007 00:39:59 +0200
changeset 5236 335696e2a58f
parent 5235 988ed47d9d65 (current diff)
parent 5213 b0bc8cf41ffc (diff)
child 5237 5b1f5a143c8b
merge with crew-stable
mercurial/util.py
--- a/mercurial/util.py	Thu Aug 23 13:59:52 2007 -0700
+++ b/mercurial/util.py	Fri Aug 24 00:39:59 2007 +0200
@@ -850,12 +850,16 @@
 
     Requires a directory (like /foo/.hg)
     """
-    fh, fn = tempfile.mkstemp("", "", path)
-    os.close(fh)
-    m = os.stat(fn).st_mode
-    os.chmod(fn, m ^ 0111)
-    r = (os.stat(fn).st_mode != m)
-    os.unlink(fn)
+    try:
+        fh, fn = tempfile.mkstemp("", "", path)
+        os.close(fh)
+        m = os.stat(fn).st_mode
+        os.chmod(fn, m ^ 0111)
+        r = (os.stat(fn).st_mode != m)
+        os.unlink(fn)
+    except (IOError,OSError):
+        # we don't care, the user probably won't be able to commit anyway
+        return False
     return r
 
 def execfunc(path, fallback):