[PATCH 1 of 3] Add a new function, filesystem_case

Adrian Buehlmann adrian at cadifra.com
Sun Apr 27 06:17:17 CDT 2008


On 26.04.2008 17:57, Matt Mackall wrote:
> I think we should only need to use checkfolding once per hg invocation, on the
> repository's .hg directory.

Suggestion: add new member function foldspaths on class
mercurial.localrepo.localrepository:

diff -r 626cb86a6523 mercurial/localrepo.py
--- a/mercurial/localrepo.py    Thu Apr 24 17:16:02 2008 +0200
+++ b/mercurial/localrepo.py    Sun Apr 27 13:14:47 2008 +0200
@@ -100,6 +100,7 @@
         self.filterpats = {}
         self._datafilters = {}
         self._transref = self._lockref = self._wlockref = None
+        self._foldspaths = not util.checkfolding(self.path)

     def __getattr__(self, name):
         if name == 'changelog':
@@ -478,6 +479,11 @@

     def rjoin(self, f):
         return os.path.join(self.root, util.pconvert(f))
+
+    def foldspaths(self):
+        '''True, if the repository is on file system that folds paths.
+        Assumed to be invariant and steady over whole repository.'''
+        return self._foldspaths

     def file(self, f):
         if f[0] == '/':



More information about the Mercurial-devel mailing list