Mercurial > public > mercurial-scm > hg
comparison mercurial/context.py @ 23402:2963d5c9d90b stable
rename: properly report removed and added file as modified (issue4458)
The result of 'hg rm' + 'hg rename' disagreed with the one from
'hg rename --force'. We align them on 'hg move --force' because it agrees with
what 'hg status' says after the commit.
Stopping reporting a modified file as added puts an end to the hg revert confusion in this
situation (issue4458).
However, reporting the file as modified also prevents revert from restoring the copy
source. We fix this in a later changeset.
Git diff also stop reporting the add in the middle of the chain as add. Not
sure how important (and even wrong) it is.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Mon, 24 Nov 2014 18:42:56 -0800 |
parents | fd1bab28a8cc |
children | b913c394386f b1179dabc6de |
comparison
equal
deleted
inserted
replaced
23401:fd1bab28a8cc | 23402:2963d5c9d90b |
---|---|
1335 self._repo.ui.warn(_("copy failed: %s is not a file or a " | 1335 self._repo.ui.warn(_("copy failed: %s is not a file or a " |
1336 "symbolic link\n") % dest) | 1336 "symbolic link\n") % dest) |
1337 else: | 1337 else: |
1338 wlock = self._repo.wlock() | 1338 wlock = self._repo.wlock() |
1339 try: | 1339 try: |
1340 if self._repo.dirstate[dest] in '?r': | 1340 if self._repo.dirstate[dest] in '?': |
1341 self._repo.dirstate.add(dest) | 1341 self._repo.dirstate.add(dest) |
1342 elif self._repo.dirstate[dest] in 'r': | |
1343 self._repo.dirstate.normallookup(dest) | |
1342 self._repo.dirstate.copy(source, dest) | 1344 self._repo.dirstate.copy(source, dest) |
1343 finally: | 1345 finally: |
1344 wlock.release() | 1346 wlock.release() |
1345 | 1347 |
1346 def _filtersuspectsymlink(self, files): | 1348 def _filtersuspectsymlink(self, files): |