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 194998 - NB too aggressive with implicit "svn rm"
Summary: NB too aggressive with implicit "svn rm"
Status: RESOLVED FIXED
Alias: None
Product: versioncontrol
Classification: Unclassified
Component: Subversion (show other bugs)
Version: 7.0
Hardware: PC Windows XP
: P3 normal (vote)
Assignee: Ondrej Vrabec
URL:
Keywords: USABILITY
Depends on:
Blocks:
 
Reported: 2011-02-02 16:27 UTC by lewbloch
Modified: 2011-02-26 05:13 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description lewbloch 2011-02-02 16:27:30 UTC
NetBeans (7.0 beta) issues a Subversion remove for every time a file disappears from the working directory, be it from a NetBeans action or external action such as a mass file update or regeneration.  This is rarely if ever desired, especially as it happens without warning or permission.  It breaks the history of what should be a net update.

Scenario - run JAXB command to generate schema-handler Java source files.  This deletes and recreates *.java files, typically with the same names in the same package as previously.  If these files are version controlled, as sometimes they are, then one has to shut down NetBeans before and restart after this regeneration, otherwise it automatically SVN removes all the files, then SVN adds the same files as new, breaking the history.

This is unacceptable.  NB should only remove from (or add to) the repository as the result of an explicit version-control command, not implicitly and in so consistently damaging a way.
Comment 1 Ondrej Vrabec 2011-02-02 16:53:18 UTC
We'll try to deal with it an find some better heuristics. It has probably become more visible and irritating for someone with the new filesystem watcher built inside NetBeans.
In the meantime, please run the IDE with -J-Dorg.netbeans.modules.subversion.deleteMissingFiles=false - this one turns the automatic metadata correction off.
Comment 2 lewbloch 2011-02-03 03:28:14 UTC
That is an excellent solution.  I suggest only that NB reverse the default and require an explicit 
"-J-Dorg.netbeans.modules.subversion.deleteMissingFiles=true" 
to enable the feature, with accompanying fanfare to educate us on the feature.
Comment 3 Ondrej Vrabec 2011-02-07 15:58:01 UTC
How exactly does the generator work? It removes *.java files an recreates them. But does it also remove parent packages? Does it somehow touch any folder? Because if it does (if it removes a folder/package) i am afraid the working copy gets broken (metadata will be deleted along with the files and folders).
And one more thing, if we don't svn rm the files and the generator simply removes a file and does not recreate it (possibly because the definition of the class is removed from the model), the file will remain *missing* in the WC. What would you suggest we should do in such case? Will you be satisfied with the missing status of such file?
Comment 4 lewbloch 2011-02-07 20:06:42 UTC
Regarding, "if we don't svn rm the files and the generator simply
removes a file and does not recreate it (possibly because the definition of the
class is removed from the model), the file will remain *missing* in the WC.
What would you suggest we should do in such case? Will you be satisfied with
the missing status of such file?"

What does "WC" mean?

I can only speak for myself, but of course I would be satisfied with that status.  Why wouldn't I be?

What does *not* satisfy me is the removal from Subversion without permission, without even warning, and without documentation that this is what happens.

The risk incurred by failing to remove a file from SVN is much, much lower than the risk incurred by inappropriate removal of a file.  Who in the world ever thought it was a good idea to quietly destroy the source repository?  HUGE mistake!
Comment 5 Ondrej Vrabec 2011-02-07 20:18:35 UTC
> Who in the world ever thought it was a good idea to quietly destroy the source repository?  HUGE mistake!
Well, actually, ruby users. They run external scripts that delete (not svn rm, but simple filesystem remove) files in WC (working copy) and eventually complain that the files remain missing and during a subsequent update are recreated instead of removed from the repository.
Don't take me wrong, with my previous comment i simply wanted to make sure that you understand all consequences.

But you did not answer my first question. Does the external generator removes also folders or just files?
Comment 6 Ondrej Vrabec 2011-02-07 20:41:42 UTC
just for info: the current behavior is the result of the fix for bug #142698
Comment 7 Ondrej Vrabec 2011-02-21 12:59:51 UTC
*** Bug 153504 has been marked as a duplicate of this bug. ***
Comment 8 Ondrej Vrabec 2011-02-25 14:37:53 UTC
fix: http://hg.netbeans.org/core-main/rev/8aba47cac335
Comment 9 Quality Engineering 2011-02-26 05:13:39 UTC
Integrated into 'main-golden', will be available in build *201102260001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/8aba47cac335
User: Ondrej Vrabec <ovrabec@netbeans.org>
Log: Issue #194998 - NB too aggressive with implicit "svn rm"