##// END OF EJS Templates
hghave: add a check for docker support...
hghave: add a check for docker support This currently refuses to operate if on a non-Linux host. I suspect that Docker running on FreeBSD 11 or on an Illumos derivative would work fine, but I don't have ready access to such a system. On OS X using boot2docker (I used a hacky xhyve-based one for testing), it won't work because $TESTTEMP doesn't end up inside the set of directories that get forwarded to the boot2docker VM, so you can't actually drop debs in the $TESTTEMP at all. It would be possible (probably even trivial) to hack around this by using a randomly-named temporary directory inside the working directory, but that seems unlikely to be useful enough to justify the ugliness.

File last commit:

r19378:9de689d2 default
r26111:dcc12365 default
Show More
casesmash.py
34 lines | 884 B | text/x-python | PythonLexer
import os, __builtin__
from mercurial import util
def lowerwrap(scope, funcname):
f = getattr(scope, funcname)
def wrap(fname, *args, **kwargs):
d, base = os.path.split(fname)
try:
files = os.listdir(d or '.')
except OSError:
files = []
if base in files:
return f(fname, *args, **kwargs)
for fn in files:
if fn.lower() == base.lower():
return f(os.path.join(d, fn), *args, **kwargs)
return f(fname, *args, **kwargs)
scope.__dict__[funcname] = wrap
def normcase(path):
return path.lower()
os.path.normcase = normcase
for f in 'file open'.split():
lowerwrap(__builtin__, f)
for f in "chmod chown open lstat stat remove unlink".split():
lowerwrap(os, f)
for f in "exists lexists".split():
lowerwrap(os.path, f)
lowerwrap(util, 'posixfile')