开发者

Mercurial: Can you track changes across a file that has been renamed to another tracked file?

开发者 https://www.devze.com 2023-02-04 12:26 出处:网络
I know that you can track changes to renamed files from a repo to it\'s clone. However, I seem to have an issue when I rename a file to a file name that is already being tracked. In essence, I want to

I know that you can track changes to renamed files from a repo to it's clone. However, I seem to have an issue when I rename a file to a file name that is already being tracked. In essence, I want to copy over a tracked file.

Files in original repo:

application.txt
special.txt

Then clone the repo, delete application.txt and rename special.txt to be application.txt

I wou开发者_开发技巧ld expect that the next time I made changes to special.txt in the original repo, the changes would carry over to application.txt. However, it doesn't. I get this message

local changed special.txt which remote deleted
use (c)hanged version or (d)eleted?

Trying this same thing out in Git seems to have the same results. Renaming a file to a brand new name has no issues while trying to rename a file that has already been 'taken' causes conflicts. Is there any way around this?


I wouldn't really call this a bug, as you have for all purposes just changed the contents of a file that mercurial is already tracking. Mercurial tracks files by file name and extension, and you could make the case that this is no different than just replacing the entire contents of the file.


I just had this problem in a real world project with Mercurial. GIT is also seeing bogus conflicts (special.txt deleted and updated).

Bazaar has proper rename support and it merges this case correctly (changes to special.txt are carried over and application.txt get updated as expected). The problem with Bazaar though (at least for me) is that it lacks IntelliJ support. There are 2 plugins, the most recent has not been updated for 3 years, and last time i tried it was unusable with recent IntelliJ versions. Since "bzr mv" and "bzr rename" need to be invoked by the IDE at the time of refactoring, the lack of support makes Bazaar unusable for me.

If you want IntelliJ support for this, vote here: http://youtrack.jetbrains.com/issue/IDEABKL-5344

0

精彩评论

暂无评论...
验证码 换一张
取 消