How to rename a java class and it's usages with Mercurial support?
when you rename a java file, it's class definition in file and it's usages should b开发者_运维百科e changed. does mercurial support this feature? I'm using Intellij Idea and unfortunately it doesn't support mercurial. I want to track rename task with mercurial completely similar to all Idea does with subversion. can anybody help me?
thanks lot
I don't know anything about IntelliJ, but I know something about the command line which I hope will help you.
You can use
hg addremove --similarity 90
on the command line to make Mercurial look at your files and search for renames. By setting the similarity parameter to a value less than 100, you tell Mercurial that is should treat almost-similar files as renames.
So if Foo.java
has disappeared from the filesystem and Bar.java
has appeared, then Mercurial will be able to figure out that Foo.java
was simply renamed to Bar.java
while updating the class name from Foo
to Bar
.
Use hg status -C
to double-check the file status after running addremove.
精彩评论