[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[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:
I have a Java class (Foo.java) that needs to be renamed FooImpl.java as part of an overall code cleanup. There are a number of self-references in the class to the current class name (static member references, etc.) in addition to the declaration and constructor(s).

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.

Thanks!

Michael Schechter
RESPONSE, LLC
Lead Telematics Specialist
mschechter_at_national.aaa.com<BLOCKED::mailto:mschechter_at_national.aaa.com>
407-444-7520
RESPONSESupport_at_national.aaa.com<BLOCKED::mailto:RESPONSESupport_at_national.aaa.com>

________________________________
This communication (including all attachments) is intended solely for
the use of the person(s) to whom it is addressed and should be treated
as a confidential AAA communication. If you are not the intended
recipient, any use, distribution, printing, or copying of this email is
strictly prohibited. If you received this email in error, please
immediately delete it from your system and notify the originator. Your
cooperation is appreciated.

------------------------------------------------------
http://subclipse.tigris.org/ds/viewMessage.do?dsForumId=1047&dsMessageId=2618070

To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_subclipse.tigris.org].
Received on 2010-06-07 21:18:46 CEST

This is an archived mail posted to the Subclipse Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.