# HG changeset patch
# User Paul Moore
# Date 2008-06-06 07:29:16
# Node ID 03a836ca6fdede24dc4f06c4cceb5520ffdc94be
# Parent 3101e30fd762db36cb82566cfef8b4f2506baaec
Add a folding() method to dirstate
The method returns True if the dirstate is on a case folding filesystem.
diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py
--- a/mercurial/dirstate.py
+++ b/mercurial/dirstate.py
@@ -66,12 +66,18 @@ class dirstate(object):
elif name == '_checkexec':
self._checkexec = util.checkexec(self._root)
return self._checkexec
+ elif name == '_folding':
+ self._folding = not util.checkfolding(self._join('.hg'))
+ return self._folding
else:
raise AttributeError, name
def _join(self, f):
return os.path.join(self._root, f)
+ def folding(self):
+ return self._folding
+
def getcwd(self):
cwd = os.getcwd()
if cwd == self._root: return ''