# HG changeset patch # User Benoit Boissinot # Date 1187908799 -7200 # Node ID 335696e2a58ff9a9fc705afcadf13ed9151ee7f4 # Parent 988ed47d9d65eeebb2591ff9294094f507f28e86# Parent b0bc8cf41ffc9eba6eda36ea986f56c7abaefa44 merge with crew-stable diff --git a/mercurial/util.py b/mercurial/util.py --- a/mercurial/util.py +++ b/mercurial/util.py @@ -850,12 +850,16 @@ def checkexec(path): 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):