Merge with crew

This commit is contained in:
Brendan Cully 2007-08-23 19:52:15 -07:00
commit 41c866722b
3 changed files with 20 additions and 8 deletions

View File

@ -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):

View File

@ -1,6 +1,7 @@
#!/bin/sh
hg init
hg init t
cd t
echo foo > a
hg add a
hg commit -m "1" -d "1000000 0"
@ -12,4 +13,5 @@ hg verify 2>/dev/null || echo verify failed
chmod -w .hg/store/data/a.i
echo barber > a
hg commit -m "2" -d "1000000 0" 2>/dev/null || echo commit failed
chmod -w ../t
hg diff --nodates

View File

@ -14,3 +14,9 @@ crosschecking files in changesets and manifests
checking files
1 files, 1 changesets, 1 total revisions
commit failed
diff -r c1fab96507ef a
--- a/a
+++ b/a
@@ -1,1 +1,1 @@ foo
-foo
+barber