[PATCH 1 of 3] Add a folding() method to dirstate

Paul Moore p.f.moore at gmail.com
Tue Jun 3 11:55:32 CDT 2008


# HG changeset patch
# User "Paul Moore <p.f.moore at gmail.com>"
# Date 1211275519 -3600
# Node ID 84939eb9dcca1152dc98cb2d58259c922b57177f
# Parent  170818dad56b671a4782794fb5da02635cfe6681
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,11 +66,17 @@
         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()


More information about the Mercurial-devel mailing list