This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 151220

Summary: Subversion CopyTo/Switch selects Library folder
Product: versioncontrol Reporter: squib <squib>
Component: SubversionAssignee: issues@versioncontrol <issues>
Status: VERIFIED FIXED    
Severity: blocker CC: sustaining
Priority: P2 Keywords: RANDOM
Version: 6.x   
Hardware: All   
OS: Windows XP   
Issue Type: DEFECT Exception Reporter:
Attachments: Screenshot where you can see that project Controls is selected in the explorer but Switch Libraries is shown in the dialog

Description squib 2008-10-23 21:26:20 UTC
If you want to "copy to/switch to" a branch sometimes the Library folder is selected in the dialog popup instead of the
project. 

We are using the shared library functionality introduced with Netbeans 6.1. We find out that it must have something to
do with the nblibraries.properties file.

As a workaround we change the folder where nblibraries.properties is stored from the project properties window. Finally
if you retry to copy to/switch to a branch the actual project is selected. Unfortunately this does not always work.
Comment 1 Tomas Stupka 2008-10-24 08:46:05 UTC
> If you want to "copy to/switch to" a branch sometimes the Library folder is selected in the dialog 
> popup instead of the project.

unfortunately, it's not fully clear to me what your problem is, however, i guess you meant the "Repository Folder" field
in the copy/switch dialogs, am i right?

the way, the folder gets preselected, is that it always takes the last used location. If there were recently used more
locations, they all are available from the fields combo list. It's hard or even impossible to find out from the
selections context what should be the destination/source for the copy/switch operation and I'm afraid there is nothing
we could do about it.


could you please elaborate in case this isn't your problem? 

what exactly is your project setup? 
what exactly is the lib folder? is it under your project root or is located somewhere else on your disk?
in what field of the copy dialog is the lib folder selected? in the "local folder" field or the repository location, ...?
anythig else?

thanks
 

Comment 2 squib 2008-10-24 09:05:28 UTC
Created attachment 72573 [details]
Screenshot where you can see that project Controls is selected in the explorer but Switch Libraries is shown in the dialog
Comment 3 squib 2008-10-24 09:19:51 UTC
No I do not mean the Repository Folder. This could be handled very easily just by selecting the right project. 

The attached pic shows it: In the project explorer Controls is selected. The user right-clicked on the project and chose
Subversion/Switch To. Then the dialog pops up and - surprisingly - titles "Switch Libraries". If you oversee it the
effect is that all the libs stored in Libraries get deleted and your Controls project is checked out into that folder!!

The nblibraries.properties file is set relative to the project. All projects are stored under the usual Netbeans
Projects folder. The Libraries folder is also in there. To make it clear the structure is

Netbeans Projects/Controls
Netbeans Projects/Libraries

Of course Libraries is not a project itself but just a folder where all libs are placed.
Comment 4 Tomas Stupka 2008-10-24 12:42:27 UTC
ok then, i could reproduce with 6.5 on macos:

1.) created a project - .../NetBeansProjects/JavaApplication1
2.) set "Use dedicated Folder..." to "../libraries" -> .../NetBeansProjects/libraries
3.) added a lib from libraries to JavaApp1
4.) imported the project into a svn repo
5.) imported the libs forlder into a svn repo
6.) copied the project
7.) switching between the copy and trunk seemed to work fine
8.) nb restard
9.) invoked the switch dialog and libraries was the context given for switch!

caused by the fact that the project node returns two folders - the project folder and libraries. Switch then takes the
first of them, which sometimes happens to be libraries.

suggested workarround would be to mount the netbeans projects folder in the favorites view and to switch and copy from
there. The described behaviour is related only to the projects view.

lowering to p2 - no data loss, the lib can be switched back, simple workaround exist

however, we should fix asap - in the patch 1 - if all agree.
Comment 5 Tomas Stupka 2008-11-13 13:51:22 UTC
unfortunately, it looks like we won't be to provide the fix already for 65 patch1 ...

- need a way how to get the info from projects which file is the library and which a project root. 
- the problem probably also applies for other actions - need to be evaluated

Comment 6 squib 2008-11-14 16:05:21 UTC
bad news that this issue will not be in patch 1... 

at least the problem occurs for the "copy to" and "switch to" commands. Although you can use the "favourite" folder for
these actions one has to recognize this... so it is currently "dangerous" to use these commands from the project pane -
resulting in a real mess in your workspace folder...

under this impression I do not think that P2 is appropriate.
Comment 7 Tomas Stupka 2008-12-02 14:22:14 UTC
some project nodes may return more then one folder, we let the user decide which one he wants to use for the action

changeset   : 110043:7d65968f7dc2
author      : Tomas Stupka <tstupka@netbeans.org>
date        : Tue Dec 02 15:21:53 CET 2008
summary     : #151220 - Subversion CopyTo/Switch selects Library folder
Comment 8 Quality Engineering 2008-12-05 06:14:39 UTC
Integrated into 'main-golden', will be available in build *200812050201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/7d65968f7dc2
User: Tomas Stupka <tstupka@netbeans.org>
Log: #151220 - Subversion CopyTo/Switch selects Library folder
Comment 9 squib 2008-12-05 15:50:24 UTC
great news. i will give it a try. thanks for your work.
Comment 10 Quality Engineering 2008-12-10 16:52:56 UTC
Integrated into 'main-golden', will be available in build *200812101401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/fc1e3102b590
User: Tomas Stupka <tstupka@netbeans.org>
Log: #151220 - Subversion CopyTo/Switch selects Library folder - added help context for the new FileSelector dialog
Comment 11 Peter Pis 2009-01-07 12:50:20 UTC
Verified in trunk.
Comment 13 Peter Pis 2009-01-16 10:47:22 UTC
Verified.