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.
[recent sources] Have a (old) APISupport project which uses /2 schema. Open it and try to add a test dependency - an error will be shown (and the dependency will not be added). This is because the project schema is not updated to /3 version before adding the dependency, producing incorrect project.xml, which is refused after issue #42686. See attachment for a sample project.
Created attachment 66325 [details] Sample project.
Yes, the IDE ought to switch the schema in this case.
So any change to project.xml should update to newest schema? Probably with a warning, as user will not open the project in older version of NetBeans (which version)? Or adding test dependency is a special case?
I think it can upgrade the schema quietly. /3 has been supported since the second apisupport patch update to 5.0.
*** Issue 143561 has been marked as a duplicate of this issue. ***
Duplicity is P2.
*** Issue 144913 has been marked as a duplicate of this issue. ***
core-main, #5514a2fc8214
There does not appear to be any such revision; did you ever push it?
Fix ought to be simple: in NbModuleProject.putPrimaryConfigurationData, write out in /2 only if the project is already in /2 *and* XMLUtil.validate works on the result of Util.translateXML. Else write in /3 (i.e. use the method param unchanged). Alternately, just always write in /3 and assume that the project will be read by NB 5.1+.
Take a look at issue #143966.
I haven't pushed it yet, I have some other modified files which I don't want to commit yet, thus I cannot fetch. I've read at http://wiki.netbeans.org/HgMigrationFollowups that it is encouraged to close bugs even before pushing. I'll push it ASAP so that you can review the change. I've implemented it only for <test-dependency>, since it was the only change between /2 and /3. Your suggestion implies that any such change in the future would cause NetBeans to silently upgrade to newest project schema, right? Is such behavior ok? E.g. user tries new beta of NB, opens his existing project, plays a bit with it (it is saved automatically) and then cannot open it in his working version of NB.... Not a big deal, as any real project will be in some VCS, but IMHO not a desired scenario. Maybe I'm just too defensive :).
changeset #5514a2fc8214 pushed into core-main.
"I have some other modified files which I don't want to commit yet, thus I cannot fetch" - you can use separate clones for experimental work, or http://www.selenic.com/mercurial/wiki/index.cgi/ShelveExtension (ask me for a patched copy that works with current versions of Hg), or simply save and later reapply a patch. If you routinely have a lot of changes in progress that you need more time to play with, and want to keep them clearly separate and tracked, MQ is the most powerful option. "it is encouraged to close bugs even before pushing" - sure, but it is expected that you will be pushing the fix sometime in the next day or so. Especially if you are using core-main, where you do not need to run exhaustive tests in advance. "in NbModuleProject.putPrimaryConfigurationData, write out in /2 only if the project is already in /2 *and* XMLUtil.validate works on the result of Util.translateXML" would upgrade the project schema only if it actually had to, not just for changes you could have made in the old version.
So I guess this is FIXED then?
Integrated into 'main-golden', available in build *200808300201* on http://bits.netbeans.org/dev/nightly/ Changeset: http://hg.netbeans.org/main/rev/5514a2fc8214 User: Richard Michalsky <rmichalsky@netbeans.org> Log: #142594: adding test dep. to /2 schema project silently switches to /3