[PATCH 1 of 3] Add a new function, filesystem_case
Adrian Buehlmann
adrian at cadifra.com
Sun Apr 27 15:01:28 CDT 2008
On 27.04.2008 21:42, Adrian Buehlmann wrote:
> On 27.04.2008 21:19, Adrian Buehlmann wrote:
>> On 27.04.2008 19:29, Patrick Mézard wrote:
>>> Paul Moore a écrit :
>>>> 2008/4/27 Adrian Buehlmann <adrian at cadifra.com>:
>>>>> 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:
>>>> Hmm, I think this should be a dirstate member - only the filesystem
>>>> has case folding behaviour, and the dirstate reflects the working
>>>> directory, ie the filesystem.
>>> Yes. It would also make easier to separate the working directory from the store, as it was discussed a month ago on the general list.
>> Fair enough. In case a method of localrepository needs to know whether the fs folds
>> paths or not, it can use self.dirstate.foldspaths() anyway.
>>
>> It seems dirstate doesn't know its repository, so it would probably
>> need to store that _foldspaths too -- a duplication that can be avoided.
>>
>> So here is the update:
Apologies, should be:
diff -r 626cb86a6523 mercurial/dirstate.py
--- a/mercurial/dirstate.py Thu Apr 24 17:16:02 2008 +0200
+++ b/mercurial/dirstate.py Sun Apr 27 21:56:28 2008 +0200
@@ -66,11 +66,19 @@
elif name == '_checkexec':
self._checkexec = util.checkexec(self._root)
return self._checkexec
+ elif name == '_foldspaths':
+ self._foldspaths = not util.checkfolding(self._join('.hg'))
+ return self._foldspaths
else:
raise AttributeError, name
def _join(self, f):
return os.path.join(self._root, f)
+
+ def foldspaths(self):
+ '''True, if the working dir is on a file system that folds paths.
+ Assumed to be invariant and steady over the whole working dir.'''
+ return self._foldspaths
def getcwd(self):
cwd = os.getcwd()
More information about the Mercurial-devel
mailing list