Show More
@@ -362,16 +362,34 b' class dirstate(object):' | |||||
362 | except KeyError: |
|
362 | except KeyError: | |
363 | self._ui.warn(_("not in dirstate: %s\n") % f) |
|
363 | self._ui.warn(_("not in dirstate: %s\n") % f) | |
364 |
|
364 | |||
365 |
def _normalize(self, path, known |
|
365 | def _normalize(self, path, isknown): | |
366 |
norm |
|
366 | normed = os.path.normcase(path) | |
367 |
fold |
|
367 | folded = self._foldmap.get(normed, None) | |
368 |
if fold |
|
368 | if folded is None: | |
369 |
if known |
|
369 | if isknown or not os.path.lexists(os.path.join(self._root, path)): | |
370 |
fold |
|
370 | folded = path | |
371 | else: |
|
371 | else: | |
372 |
fold |
|
372 | folded = self._foldmap.setdefault(normed, | |
373 | util.fspath(path, self._root)) |
|
373 | util.fspath(path, self._root)) | |
374 |
return fold |
|
374 | return folded | |
|
375 | ||||
|
376 | def normalize(self, path, isknown=False): | |||
|
377 | ''' | |||
|
378 | normalize the case of a pathname when on a casefolding filesystem | |||
|
379 | ||||
|
380 | isknown specifies whether the filename came from walking the | |||
|
381 | disk, to avoid extra filesystem access | |||
|
382 | ||||
|
383 | The normalized case is determined based on the following precedence: | |||
|
384 | ||||
|
385 | - version of name already stored in the dirstate | |||
|
386 | - version of name stored on disk | |||
|
387 | - version provided via command arguments | |||
|
388 | ''' | |||
|
389 | ||||
|
390 | if self._checkcase: | |||
|
391 | return self._normalize(path, isknown) | |||
|
392 | return path | |||
375 |
|
393 | |||
376 | def clear(self): |
|
394 | def clear(self): | |
377 | self._map = {} |
|
395 | self._map = {} |
General Comments 0
You need to be logged in to leave comments.
Login now