mirror of
https://github.com/facebook/sapling.git
synced 2024-10-11 01:07:15 +03:00
Merge with crew
This commit is contained in:
commit
41c866722b
@ -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):
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user