Show More
@@ -2383,7 +2383,7 b' def push(ui, repo, patch=None, **opts):' | |||||
2383 | When -f/--force is applied, all local changes in patched files |
|
2383 | When -f/--force is applied, all local changes in patched files | |
2384 | will be lost. |
|
2384 | will be lost. | |
2385 |
|
2385 | |||
2386 |
Return 0 on succ |
|
2386 | Return 0 on success. | |
2387 | """ |
|
2387 | """ | |
2388 | q = repo.mq |
|
2388 | q = repo.mq | |
2389 | mergeq = None |
|
2389 | mergeq = None |
@@ -375,16 +375,34 b' class dirstate(object):' | |||||
375 | self._ui.warn(_("not in dirstate: %s\n") % f) |
|
375 | self._ui.warn(_("not in dirstate: %s\n") % f) | |
376 | self._lastnormal.discard(f) |
|
376 | self._lastnormal.discard(f) | |
377 |
|
377 | |||
378 |
def _normalize(self, path, known |
|
378 | def _normalize(self, path, isknown): | |
379 |
norm |
|
379 | normed = os.path.normcase(path) | |
380 |
fold |
|
380 | folded = self._foldmap.get(normed, None) | |
381 |
if fold |
|
381 | if folded is None: | |
382 |
if known |
|
382 | if isknown or not os.path.lexists(os.path.join(self._root, path)): | |
383 |
fold |
|
383 | folded = path | |
384 | else: |
|
384 | else: | |
385 |
fold |
|
385 | folded = self._foldmap.setdefault(normed, | |
386 | util.fspath(path, self._root)) |
|
386 | util.fspath(path, self._root)) | |
387 |
return fold |
|
387 | return folded | |
|
388 | ||||
|
389 | def normalize(self, path, isknown=False): | |||
|
390 | ''' | |||
|
391 | normalize the case of a pathname when on a casefolding filesystem | |||
|
392 | ||||
|
393 | isknown specifies whether the filename came from walking the | |||
|
394 | disk, to avoid extra filesystem access | |||
|
395 | ||||
|
396 | The normalized case is determined based on the following precedence: | |||
|
397 | ||||
|
398 | - version of name already stored in the dirstate | |||
|
399 | - version of name stored on disk | |||
|
400 | - version provided via command arguments | |||
|
401 | ''' | |||
|
402 | ||||
|
403 | if self._checkcase: | |||
|
404 | return self._normalize(path, isknown) | |||
|
405 | return path | |||
388 |
|
406 | |||
389 | def clear(self): |
|
407 | def clear(self): | |
390 | self._map = {} |
|
408 | self._map = {} |
@@ -338,7 +338,8 b' def applyupdates(repo, action, wctx, mct' | |||||
338 | else: |
|
338 | else: | |
339 | merged += 1 |
|
339 | merged += 1 | |
340 | util.set_flags(repo.wjoin(fd), 'l' in flags, 'x' in flags) |
|
340 | util.set_flags(repo.wjoin(fd), 'l' in flags, 'x' in flags) | |
341 | if f != fd and move and os.path.lexists(repo.wjoin(f)): |
|
341 | if (move and repo.dirstate.normalize(fd) != f | |
|
342 | and os.path.lexists(repo.wjoin(f))): | |||
342 | repo.ui.debug("removing %s\n" % f) |
|
343 | repo.ui.debug("removing %s\n" % f) | |
343 | os.unlink(repo.wjoin(f)) |
|
344 | os.unlink(repo.wjoin(f)) | |
344 | elif m == "g": # get |
|
345 | elif m == "g": # get |
General Comments 0
You need to be logged in to leave comments.
Login now