Show More
@@ -464,20 +464,14 class dirstate(object): | |||||
464 | self._droppath(f) |
|
464 | self._droppath(f) | |
465 | del self._map[f] |
|
465 | del self._map[f] | |
466 |
|
466 | |||
467 |
def _ |
|
467 | def _discoverpath(self, path, normed, ignoremissing, exists, storemap): | |
468 | normed = util.normcase(path) |
|
|||
469 | folded = self._foldmap.get(normed, None) |
|
|||
470 | if folded is None: |
|
|||
471 | if isknown: |
|
|||
472 | folded = path |
|
|||
473 | else: |
|
|||
474 |
|
|
468 | if exists is None: | |
475 |
|
|
469 | exists = os.path.lexists(os.path.join(self._root, path)) | |
476 |
|
|
470 | if not exists: | |
477 |
|
|
471 | # Maybe a path component exists | |
478 |
|
|
472 | if not ignoremissing and '/' in path: | |
479 |
|
|
473 | d, f = path.rsplit('/', 1) | |
480 |
|
|
474 | d = self._normalize(d, False, ignoremissing, None) | |
481 |
|
|
475 | folded = d + "/" + f | |
482 |
|
|
476 | else: | |
483 |
|
|
477 | # No path components, preserve original case | |
@@ -487,13 +481,24 class dirstate(object): | |||||
487 |
|
|
481 | # against dirstate | |
488 |
|
|
482 | if '/' in normed: | |
489 |
|
|
483 | d, f = normed.rsplit('/', 1) | |
490 |
|
|
484 | d = self._normalize(d, False, ignoremissing, True) | |
491 |
|
|
485 | r = self._root + "/" + d | |
492 |
|
|
486 | folded = d + "/" + util.fspath(f, r) | |
493 |
|
|
487 | else: | |
494 |
|
|
488 | folded = util.fspath(normed, self._root) | |
495 |
|
|
489 | storemap[normed] = folded | |
|
490 | ||||
|
491 | return folded | |||
496 |
|
492 | |||
|
493 | def _normalize(self, path, isknown, ignoremissing=False, exists=None): | |||
|
494 | normed = util.normcase(path) | |||
|
495 | folded = self._foldmap.get(normed, None) | |||
|
496 | if folded is None: | |||
|
497 | if isknown: | |||
|
498 | folded = path | |||
|
499 | else: | |||
|
500 | folded = self._discoverpath(path, normed, ignoremissing, exists, | |||
|
501 | self._foldmap) | |||
497 | return folded |
|
502 | return folded | |
498 |
|
503 | |||
499 | def normalize(self, path, isknown=False, ignoremissing=False): |
|
504 | def normalize(self, path, isknown=False, ignoremissing=False): |
General Comments 0
You need to be logged in to leave comments.
Login now