[Subclipse-users] Java refactoring and diff creation
From: Schechter, Michael <MSchechter_at_national.aaa.com>
Date: Mon, 7 Jun 2010 15:18:24 -0400
I have run into a Subversion problem that seems to be exacerbated by using Subclipse when refactoring Java code.
Here's the problem:
When I use the Refactor -> Rename option, it triggers an svn 'move' that results in a delete of Foo.java and an 'add' of FooImpl.java. As part of our software development process, I cannot commit before another team member reviews my code. To facilitate this, I can just create a diff with my changes and attach it to the bug.
That's where it sort of falls apart - My teammate can't apply the diff, because the internal changes to FooImpl.java are assumed to be on the current revision of FooImpl.java, which isn't in the repository yet (this patch is supposed to add it), and the information about FooImpl.java being a new file are not present. The deletion of Foo.java is propagated without issue.
I've done some experimentation, and a new file (a pure 'add') works just fine with diff creation, even if the content is modified extensively after the 'add'. I also did some research, and found more than one reference that said that it's not a good idea to mix operations in a single commit (mixing a 'rename' with actual changes to the file, for example).
I have duplicated the diff creation behavior on Windows (using either Subclipse or TortoiseSVN) and RHEL 5 (using the Linux command-line client). The behavior is consistent - if I modify the destination of a rename after the commit, it loses track of the fact that this is a new file, and treats it instead as modifications to a file already in the repository.
This may be a better question for the Subversion users list; if so, please let me know. The reason I posted here first is this is not a general-use issue for me - it only affects the kind of file change triggered by Java refactoring and my subsequent inability to include the changes in a diff for review. This is not an issue for me outside of Eclipse.
Please let me know if you have any solution or suggestions for a workaround.
To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_subclipse.tigris.org].
This is an archived mail posted to the Subclipse Users mailing list.