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

[Subclipse-users] Rename Package refactoring causes "already under version control" error

From: Keith Bonawitz <bonawitz_at_mit.edu>
Date: 2006-07-05 23:31:14 CEST

(On Eclipse 3.2 Callisto, Subclipse 1.1.2)

When I try to use the "Rename Package" refactoring (with the "Rename
Subpackages" option enabled) in order to move a folder with several
subfolders, the refactoring throws an exception (I get a dialog with
"Undo"/"Abort", and the details "Problems encountered while moving
resources."

Structure of my Eclipse Project:
+ old
  + package1
    + Class1.java
  + package2
    + Class2.java

Refactoring attempted: Rename package "old" to "updated," renaming the
subpackages as well. Checking the SVN log, I see that add-N is being
applied to the parent directory multiple times.

add-N C:\workspace\Project\updated
    A C:/workspace/Project/updated
move C:/workspace/Project/old/package1 C:/workspace/Project/updated/package1
    A C:/workspace/Project/updated/package1
    D C:/workspace/Project/old/package1/Class1.java
    D C:/workspace/Project/old/package1
add-N C:\workspace\Project\updated
    svn: 'C:\workspace\Project\updated' already under version control

This looks like it might be related to Daniel Serodio's issue from
June 6, 2006 (copied below), but Mark Phippard wrote that that bug has
been fixed and I should be in subclipse 1.1.2 (the version I'm using).
 I suspect that this is a similar but distinct issue.

Thanks,
Keith

---------------
---------- Forwarded message ----------
From: Daniel Serodio <daniel.listas@xxx.com.br>
To: Subclipse Users <users@subclipse.tigris.org>
Date: Tue, 06 Jun 2006 17:10:36 -0300
Subject: Error performing "Move" refactoring to new package
I selected 2 classes, and chose "Refactor > Move". Then, in the "Choose
destination" dialog, I clicked on "Create Package...", and created a new
package.

When I clicked on Ok, to perform the refactoring, I got an error from
Subclipse, because it tried to "add" the newly-created package twice.

Here is the (simplified) log in SVN Console from this refactoring:

add-N new/package
   A new/package
move old/file1.java new/package/file1.java
   A new/package/file1.java
   D old/file1.java
add-N new/package
   svn: 'new/package' already under version control

---------- Forwarded message ----------
From: Mark Phippard <markp@softlanding.com>
To: users@subclipse.tigris.org
Date: Tue, 6 Jun 2006 16:35:39 -0400
Subject: Re: [Subclipse-users] Error performing "Move" refactoring to
new package
Daniel Serodio <daniel.listas@xxx.com.br> wrote on 06/06/2006 04:10:36 PM:

> I selected 2 classes, and chose "Refactor > Move". Then, in the "Choose
> destination" dialog, I clicked on "Create Package...", and created a new
> package.
>
> When I clicked on Ok, to perform the refactoring, I got an error from
> Subclipse, because it tried to "add" the newly-created package twice.

Thanks for the easy to follow reproduction steps. I have reproduced and
fixed the problem and will include in the next releases of 1.1 and 1.0.

The problem was caused by a performance optimization we added to the "add"
routine where we took out a manual refresh of the svn status. The problem
in this scenario is that the svn status is not refreshed until the end if
the process so it does not recognize that the folder has already been
added to version control. I just had to add a status refresh into the
refactoring when it creates the folder.

As a workaround, if you create the package and add it to version control
prior to moving the classes, it will work fine.

Mark

_____________________________________________________________________________
Scanned for SoftLanding Systems, Inc. and SoftLanding Europe Plc by
IBM Email Security Management Services powered by MessageLabs.
_____________________________________________________________________________

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subclipse.tigris.org
For additional commands, e-mail: users-help@subclipse.tigris.org
Received on Wed Jul 5 23:31:28 2006

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.