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 36113 - *** LOSS OF WORK during CVS Update ***
Summary: *** LOSS OF WORK during CVS Update ***
Status: VERIFIED FIXED
Alias: None
Product: obsolete
Classification: Unclassified
Component: vcscore (show other bugs)
Version: 3.x
Hardware: All All
: P1 blocker (vote)
Assignee: Martin Entlicher
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-09-16 14:17 UTC by Martin Entlicher
Modified: 2004-02-23 10:57 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
The contextual diff of the fix. (12.40 KB, patch)
2004-01-28 18:09 UTC, Martin Entlicher
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Entlicher 2003-09-16 14:17:13 UTC
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.
Comment 1 Martin Entlicher 2003-09-16 14:19:21 UTC
Scheduling for 4.0.
A similar solution to that one in issue #36065 will be implemented in
vcscore module.
Comment 2 Martin Entlicher 2003-09-16 17:09:07 UTC
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
Comment 4 Martin Entlicher 2003-09-24 17:37:06 UTC
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.

Comment 5 Martin Entlicher 2003-09-25 13:32:03 UTC
FYI: this does not work at all in projects builds due to issue #36280.
Comment 6 Martin Entlicher 2003-09-25 16:33:44 UTC
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
Comment 7 Jiri Kovalsky 2003-10-06 15:28:38 UTC
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.
Comment 8 Martin Entlicher 2004-01-28 18:09:11 UTC
Created attachment 13123 [details]
The contextual diff of the fix.
Comment 9 dmladek 2004-02-12 10:57:00 UTC
OK in Arrow SE6 2004Q1
Comment 10 dmladek 2004-02-12 10:59:41 UTC
forgot:
OK in Arrow SE6 2004Q1 in Solaris
Comment 11 dmladek 2004-02-18 11:01:25 UTC
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
Comment 12 Martin Entlicher 2004-02-18 11:10:00 UTC
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 "".
Comment 13 Martin Entlicher 2004-02-18 11:15:47 UTC
Fixed in trunk:

/cvs/vcscore/src/org/netbeans/modules/vcscore/VcsFileSystem.java,v 
<--  VcsFileSystem.java
new revision: 1.247; previous revision: 1.246
Comment 14 dmladek 2004-02-18 12:39:03 UTC
and the same problem is also in Arrow SE6 2004Q1.
(I thought that it is right behaviour, but definitly it isn't)
Comment 15 dmladek 2004-02-18 14:05:56 UTC
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.
Comment 16 Martin Entlicher 2004-02-19 17:52:25 UTC
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
Comment 17 David Kaspar 2004-02-20 16:35:21 UTC
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="";
Comment 18 Martin Entlicher 2004-02-20 16:48:09 UTC
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
Comment 19 David Kaspar 2004-02-23 10:57:55 UTC
Verified in #200402221900