changeset 5213:b0bc8cf41ffc

merge with -stable
author Benoit Boissinot <benoit.boissinot@ens-lyon.org>
date Fri, 24 Aug 2007 00:39:16 +0200
parents 316ce5e85b3e (diff) bddb4ff134c0 (current diff)
children 551958d5082c 335696e2a58f
files mercurial/util.py
diffstat 1 files changed, 10 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/util.py	Thu Aug 23 12:23:07 2007 -0700
+++ b/mercurial/util.py	Fri Aug 24 00:39:16 2007 +0200
@@ -802,12 +802,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):