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.
This is a variant of issue #36065 for command-line VCS systems. The fist problem (1s resolution of file modification was already solved - VcsAction.java, revision: 1.78 and 1.72.4.5). The second problem (disable file modification in the IDE while update is running) is to be solved.
Scheduling for 4.0. A similar solution to that one in issue #36065 will be implemented in vcscore module.
The problem is fixed in a similar way to issue #36065 in the main trunk: Checking in cmdline/ExecuteCommand.java; /cvs/vcscore/src/org/netbeans/modules/vcscore/cmdline/ExecuteCommand.java,v <-- ExecuteCommand.java new revision: 1.63; previous revision: 1.62 done Checking in commands/CommandCustomizationSupport.java; /cvs/vcscore/src/org/netbeans/modules/vcscore/commands/CommandCustomizationSupport.java,v <-- CommandCustomizationSupport.java new revision: 1.13; previous revision: 1.12 done Checking in Bundle.properties; /cvs/vcscore/src/org/netbeans/modules/vcscore/Bundle.properties,v <-- Bundle.properties new revision: 1.26; previous revision: 1.25 done Checking in VcsFileSystem.java; /cvs/vcscore/src/org/netbeans/modules/vcscore/VcsFileSystem.java,v <-- VcsFileSystem.java new revision: 1.230; previous revision: 1.229 done And in the prj40_prototype branch: Checking in cmdline/ExecuteCommand.java; /cvs/vcscore/src/org/netbeans/modules/vcscore/cmdline/ExecuteCommand.java,v <-- ExecuteCommand.java new revision: 1.52.4.9; previous revision: 1.52.4.8 done Checking in Bundle.properties; /cvs/vcscore/src/org/netbeans/modules/vcscore/Bundle.properties,v <-- Bundle.properties new revision: 1.24.4.4; previous revision: 1.24.4.3 done Checking in VcsFileSystem.java; /cvs/vcscore/src/org/netbeans/modules/vcscore/VcsFileSystem.java,v <-- VcsFileSystem.java new revision: 1.193.2.12; previous revision: 1.193.2.11 done
An additional change made: ErrorManager is used to annotate the Exception, there's no need to create a sub-class for this purpose. http://vcscore.netbeans.org/source/browse/vcscore/src/org/netbeans/modules/vcscore/VcsFileSystem.java.diff?r1=1.193.2.12&r2=1.193.2.13 http://vcscore.netbeans.org/source/browse/vcscore/src/org/netbeans/modules/vcscore/VcsFileSystem.java.diff?r1=1.230&r2=1.231
There's still one (small) problem that needs to be fixed: After the file is saved automatically (before the command is executed), it takes some (unspecified) time, before the command is executed. The waiting for 1s after the save adds this one second to this time. Therefore there's this "hole" in time during which the user can freely modify any source and this will not be catched by the update command. This is because the files are locked just before the update command is started. To fix this, the save process would have to be moved (or copied) from the central place in CommandProcessor to the executor of the particular command. The files need to be "locked" first and then saved. This should be possible, since the Editor should be already holding locks for modified objects.
FYI: this does not work at all in projects builds due to issue #36280.
So, hopefully it's finally fixed. After the files are locked, save is performed once more to save any possibly newly modified files. The change with ErrorManager.annotate() was reverted, because it does not work unfortunately (issue #9069 was reopened again). Checking in cmdline/ExecuteCommand.java; /cvs/vcscore/src/org/netbeans/modules/vcscore/cmdline/ExecuteCommand.java,v <-- ExecuteCommand.java new revision: 1.64; previous revision: 1.63 done Processing log script arguments... More commits to come... Checking in VcsAction.java; /cvs/vcscore/src/org/netbeans/modules/vcscore/VcsAction.java,v <-- VcsAction.java new revision: 1.79; previous revision: 1.78 done Checking in VcsFileSystem.java; /cvs/vcscore/src/org/netbeans/modules/vcscore/VcsFileSystem.java,v <-- VcsFileSystem.java new revision: 1.232; previous revision: 1.231 done Checking in cmdline/ExecuteCommand.java; /cvs/vcscore/src/org/netbeans/modules/vcscore/cmdline/ExecuteCommand.java,v <-- ExecuteCommand.java new revision: 1.52.4.10; previous revision: 1.52.4.9 done Checking in VcsAction.java; /cvs/vcscore/src/org/netbeans/modules/vcscore/VcsAction.java,v <-- VcsAction.java new revision: 1.72.4.6; previous revision: 1.72.4.5 done Checking in VcsFileSystem.java; /cvs/vcscore/src/org/netbeans/modules/vcscore/VcsFileSystem.java,v <-- VcsFileSystem.java new revision: 1.193.2.14; previous revision: 1.193.2.13 done
Well, I would say that we can consider the issue as fixed. I tried to experience the data loss but it always worked fine. Verifying in development build #200310010100 of NetBeans 4.0.
Created attachment 13123 [details] The contextual diff of the fix.
OK in Arrow SE6 2004Q1
forgot: OK in Arrow SE6 2004Q1 in Solaris
Yup, I've found that locking files doesn't work for case when you run update command on the root of FS. in todays Q-build canddate...reopening
You're right. The reason is, that the path is ".", but the file name does not begin with "." of course. "." needs to be replaced with "".
Fixed in trunk: /cvs/vcscore/src/org/netbeans/modules/vcscore/VcsFileSystem.java,v <-- VcsFileSystem.java new revision: 1.247; previous revision: 1.246
and the same problem is also in Arrow SE6 2004Q1. (I thought that it is right behaviour, but definitly it isn't)
I've check the fix in NB36 dev builded from actual sources. It behaves fine now: cvs->update on root of FS will lock whole dir hiearchy agains modification.
The fix was merged into QBE200402171900 branch: /cvs/vcscore/src/org/netbeans/modules/vcscore/VcsFileSystem.java,v <-- VcsFileSystem.java new revision: 1.246.4.1; previous revision: 1.246
Reopening because: When I invoke "Update" command on root FS node, editor content is not refreshed with the updated content. Solution: Add following line to org.netbeans.modules.vcscore.VCSFileSystem on line 3546: if (".".equals (path)) path="";
I hope that this is really the final fix. ;-) /cvs/vcscore/src/org/netbeans/modules/vcscore/VcsFileSystem.java,v <-- VcsFileSystem.java new revision: 1.248; previous revision: 1.247
Verified in #200402221900