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 180504 - File Copy Functionality does not always work
Summary: File Copy Functionality does not always work
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Filesystems (show other bugs)
Version: 6.x
Hardware: All All
: P2 normal (vote)
Assignee: Jaroslav Tulach
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-02-09 12:10 UTC by janunezc
Modified: 2010-03-26 05:31 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
I have randomly failing test that seems to indicate something is wrong with recursive listener (66.64 KB, text/html)
2010-03-16 08:53 UTC, Jaroslav Tulach
Details

Note You need to log in before you can comment on or make changes to this bug.
Description janunezc 2010-02-09 12:10:11 UTC
As part of Project Configurations available to PHP projects in Sources category, there is an option to "Copy files from sources folder to another location".

The main use I find for that capability is to be able to keep sources in a controlled folder (such as subversion working folder), and then copy files to a "Deploy folder" where web server uses them, without including all Subversion files.

Well, after doing UPDATE from Subversion new versions of files won't be copied to target folder unless they are modified in the editor.

Also, it does not delete files in target folder, when they get deleted in source folder, causing an important de-sync.
Comment 1 Tomas Mysik 2010-02-09 12:54:14 UTC
(In reply to comment #0)
> Well, after doing UPDATE from Subversion new versions of files won't be copied
> to target folder unless they are modified in the editor.

How do you do the svn update? From the IDE or the command line?

> Also, it does not delete files in target folder, when they get deleted in
> source folder, causing an important de-sync.

The same question - how do you delete those files?

In order to help you, we need reliable steps to reproduce.

Feel free to reopen this issue, do not create a new one. Thanks.
Comment 2 josenunez 2010-02-09 13:51:13 UTC
Update/Delete operations are done through the Netbeans GUI.

What should happen (and does not) is that files are synchronized (not just copied) from sources folder to target folder when I click RUN or DEBUG button (or access RUN or DEBUG functionality from contextual menu)
Comment 3 Tomas Mysik 2010-02-10 14:17:12 UTC
(In reply to comment #2)
> Update/Delete operations are done through the Netbeans GUI.

Thanks for information. Please, would you be able to provide _reliable_ steps to reproduce? These are needed in order to try to fix this issue (you know, this behaviour is simply tricky and not always reliable because Java does not have any possibility to listen to file changes).

> What should happen (and does not) is that files are synchronized (not just
> copied) from sources folder to target folder when I click RUN or DEBUG button
> (or access RUN or DEBUG functionality from contextual menu)

Sorry, I don't get this - if you use copying files to another location, then this should happen immediately and not after Run or Debug actions are invoked.

Thanks.
Comment 4 josenunez 2010-02-10 14:58:50 UTC
Step 1. Create a project PHP in a subversion repository (kenai, code.google.com, sourceforge)

Step 2. Set up the project in two computers with netbeans. Setup source files apart from web server htdocs folder. Setup source files to be copied from source to target www/htdocs folder. Then run the website in each computer. 

Step 3. UPDATE project code in both computers using Subversion>Update contextual menu in Netbeans' Project window

Step 4. Modify code in computer #1 and use Subversion>Commit to upload changes into the repository.

Step 5. Update code in computer #2 using the Subversion>Update contextual menu

Step 6. Run the web site in netbeans on computer #2

Step 7. The web site is not updated with the most recent code.
Comment 5 Tomas Mysik 2010-02-11 03:24:14 UTC
Thanks, I will look at it.
Comment 6 Filip Zamboj 2010-02-11 06:26:26 UTC
not reproducible with mercurial for new files and for changed files 
Product Version: NetBeans IDE Dev (Build 2010-02-11_03-04-28 )
Java: 1.6.0_16; Java HotSpot(TM) 64-Bit Server VM 14.2-b01

I will try for svn as well
Comment 7 Filip Zamboj 2010-02-12 09:10:59 UTC
reproduced on 
Product Version: NetBeans IDE Dev (Build 100212-e6ce07379033)
Java: 1.6.0_16; Java HotSpot(TM) 64-Bit Server VM 14.2-b01
Comment 8 Tomas Mysik 2010-02-25 04:11:30 UTC
Reproduced, the exact steps are:

- have a svn repo (maybe any VCS can be used?) with this file:
                    a/b/c/c.php
- create 2 clones of it
- start NB with -J-Dorg.netbeans.modules.php.project.copysupport.CopySupport.level=FINEST
- from clone 1 create a PHP project and enable copying of sources
- close NB
- using clone 2, make changes to a/b/c/c.php and svn commit
- start NB with -J-Dorg.netbeans.modules.php.project.copysupport.CopySupport.level=FINEST
- DO NOT EXPAND project node (in fact, not sure whether it makes any difference), right click and invoke Subversion > Update
- the file is updated in the IDE but not copied, from the log [1] one can see that FS changes were fired only for files in ".svn" directories but not for the c.php file itself
- result: file c.php is not copied


[1] IDE log:
FINEST [org.netbeans.modules.php.project.copysupport.CopySupport]: Getting source file for project clone1 from BaseFileObj$FileEventImpl[src=/home/gapon/tmp/svn/clone1/a/.svn,file=/home/gapon/tmp/svn/clone1/a/.svn/entries,time=Thu Feb 25 11:47:07 CET 2010,expected=true]                                                                                                                                                                                      
FINEST [org.netbeans.modules.php.project.copysupport.CopySupport]:      -> null (invisible source)                                                                                                                                
FINEST [org.netbeans.modules.php.project.copysupport.CopySupport]: Getting source file for project clone1 from BaseFileObj$FileEventImpl[src=/home/gapon/tmp/svn/clone1/a/b/.svn,file=/home/gapon/tmp/svn/clone1/a/b/.svn/entries,time=Thu Feb 25 11:47:07 CET 2010,expected=true]                                                                                                                                                                                  
FINEST [org.netbeans.modules.php.project.copysupport.CopySupport]:      -> null (invisible source)                                                                                                                                
FINEST [org.netbeans.modules.php.project.copysupport.CopySupport]: Getting source file for project clone1 from BaseFileObj$FileEventImpl[src=/home/gapon/tmp/svn/clone1/a/b/c/.svn/text-base,file=/home/gapon/tmp/svn/clone1/a/b/c/.svn/text-base/c.php.svn-base,time=Thu Feb 25 11:47:07 CET 2010,expected=true]                                                                                                                                                   
FINEST [org.netbeans.modules.php.project.copysupport.CopySupport]:      -> null (invisible source)                                                                                                                                
FINEST [org.netbeans.modules.php.project.copysupport.CopySupport]: Getting source file for project clone1 from BaseFileObj$FileEventImpl[src=/home/gapon/tmp/svn/clone1/a/b/c/.svn,file=/home/gapon/tmp/svn/clone1/a/b/c/.svn/entries,time=Thu Feb 25 11:47:07 CET 2010,expected=true]                                                                                                                                                                              
FINEST [org.netbeans.modules.php.project.copysupport.CopySupport]:      -> null (invisible source)                                                                                                                                
FINEST [org.netbeans.modules.php.project.copysupport.CopySupport]: Getting source file for project clone1 from BaseFileObj$FileEventImpl[src=/home/gapon/tmp/svn/clone1/.svn,file=/home/gapon/tmp/svn/clone1/.svn/entries,time=Thu Feb 25 11:47:07 CET 2010,expected=true]                                                                                                                                                                                          
FINEST [org.netbeans.modules.php.project.copysupport.CopySupport]:      -> null (invisible source)
Comment 9 Jaroslav Tulach 2010-03-16 08:53:12 UTC
Created attachment 95219 [details]
I have randomly failing test that seems to indicate something is wrong with recursive listener
Comment 10 Quality Engineering 2010-03-19 05:14:16 UTC
Integrated into 'main-golden', will be available in build *201003190200* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/f92292a7d25f
User: Jaroslav Tulach <jtulach@netbeans.org>
Log: #180504: The problem with failing FileUtilAddRecursiveListenerTest seems to be in not generating an event in refreshImpl under certain circumstances. Adding more logging to be able to find out what refreshImpl really does. Also making sure when a folderCreated event is delivered that the FileObjectKeepr properly attaches itself even it has no listeners.
Comment 11 Jaroslav Tulach 2010-03-25 08:35:58 UTC
Much improved in core-main#da3fc28a7250. Can you verify it is improved enough?
Comment 12 Quality Engineering 2010-03-26 05:31:29 UTC
Integrated into 'main-golden', will be available in build *201003260201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/da3fc28a7250
User: Jaroslav Tulach <jtulach@netbeans.org>
Log: #180504: GCproof recursive listener