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 231673 - project configuration is not reloaded upon branch swithching.
Summary: project configuration is not reloaded upon branch swithching.
Status: VERIFIED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: Project (show other bugs)
Version: 7.4
Hardware: PC Linux
: P2 normal (vote)
Assignee: Alexander Simon
URL:
Keywords:
: 238331 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-06-23 04:11 UTC by necktwi
Modified: 2014-05-07 14:39 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
IDE log (32.38 KB, text/plain)
2013-06-23 04:12 UTC, necktwi
Details

Note You need to log in before you can comment on or make changes to this bug.
Description necktwi 2013-06-23 04:11:52 UTC
If u made changes in project configuration, like u added include libraries or new files, in a branch and then if u switch to another branch then the project configuration of current branch is not loaded. The project configuration still belongs to previous branch.

Product Version = NetBeans IDE 7.3 (Build 201306052037)
Operating System = Linux version 3.5.0-34-generic running on i386
Java; VM; Vendor = 1.7.0_17
Runtime = Java HotSpot(TM) Client VM 23.7-b01
Comment 1 necktwi 2013-06-23 04:12:00 UTC
Created attachment 136176 [details]
IDE log
Comment 2 necktwi 2013-06-23 04:54:23 UTC
This is not a bug with versioning. Any change in project configuration files should trigger a configuration reload. If its not being done, though the project configuration files are changed manually or through branch switching, the current loaded configuration is rewritten to configuration files.
Comment 3 Ondrej Vrabec 2013-06-23 07:46:41 UTC
reporter: What kind of project do you have (java, php, other)? You marked this issue as NETFIX, does it mean you want to provide a patch and fix it yourself?
Does it help if you close and reopen the project? Does the content of the configuration files really change during branch switching?

Passing to projects, git branch switching in this case probably externally changes configuration files which the projects infrastructure probably does not handle.
Comment 4 necktwi 2013-06-23 07:59:27 UTC
I donno what NETFIX means. I thought it means 'Netbeans bug fix is required' and i can't fix this bug. Yes, the content of the
configuration files really change during branch switching. My project is in C++.

Thanq.
Comment 5 necktwi 2013-06-23 08:03:04 UTC
git is not changing the configuration files. It is doing its job perfectly. Netbeans have to just load the configuration of new branch.
Comment 6 necktwi 2013-06-23 08:10:37 UTC
hey ignore the last comment. Yes git branch switching is changing configuration files externally as it has to. anyway netbeans has to load the current configuration.
Comment 7 Ondrej Vrabec 2013-06-23 08:27:11 UTC
thanks for clarification, passing to c++
Comment 8 necktwi 2013-06-23 10:02:42 UTC
I'm afraid its not the problem with type of project. Pass it on to git plugin developers.
Comment 9 Leonid Lenyashin 2013-06-24 09:20:35 UTC
Vladimir, please, evaluate
Comment 10 Vladimir Voskresensky 2013-06-24 15:36:05 UTC
necktwi, as I see changes in file are reloaded in trunk.

Could you, please, try the last daily bits from
http://bits.netbeans.org/dev/nightly/latest/
and reopen bug if you can reproduce your issue.
It would be helpful if you can provide two states of configuration files and we'll analyze, may be some sections are not triggering refreshes (we do delta refreshes)

Thanks!
Vladimir.
Comment 11 necktwi 2013-06-26 03:44:18 UTC
Yes it is fixed in 7.3.1.
Delta refreshes are cool!
Comment 12 Q-BiC 2013-11-25 15:43:21 UTC
This issue has not been fixed or at least has been re-introduced in 7.4.

Steps to reproduce:
1) create a C++ project and initialize a Git repository with 2 branches (e.g. master & develop), or open an existing repository.
2) On branch develop, change the project configuration through netbeans.
- E.g. right-click on project in project tree > Properties. 
- I chose to change "Build/C++ Compiler/Compilation Line/Additional Options", but any field that's saved in nbproject/configurations.xml works.
- commit
3) Switch to master branch.

Check the Project Properties again. The value you just changed should also appear here, meaning nbproject/configurations.xml has not been reloaded by Netbeans after the branch switch. 

Now, for even more fun, close the project and run git status. The close caused nbproject/configurations.xml to change again. The value you changed in the develop branch is now also on disk in the master branch... This is wrong and dangerous... 

We noticed this at first by having a developer add new files and folders to his project (New Logical Folder or Add Existing Items), commit and switch to another branch. The folder-tree in netbeans did not update and clicking on the files from the "new logical folder" did nothing as the files on disk were (correctly) left behind in the previous branch... 

This mismatch is very confusing.

Not only switching branches will cause this behaviour, but also pulling from remote or resetting to a previous commit, or anything that affects nbproject/configurations.xml to change. 

I could not reproduce this for a Java project.

Product Version: NetBeans IDE 7.4 (Build 201310111528)
Java: 1.7.0_45; Java HotSpot(TM) 64-Bit Server VM 24.45-b08
Runtime: Java(TM) SE Runtime Environment 1.7.0_45-b18
System: Linux version 2.6.18-238.el5 running on amd64; UTF-8; en_US (nb)
Comment 13 Vladimir Voskresensky 2013-12-16 05:26:00 UTC
*** Bug 238331 has been marked as a duplicate of this bug. ***
Comment 14 Vladimir Voskresensky 2013-12-16 05:26:23 UTC
It looks like recent regression in 7.4
Comment 15 Alexander Simon 2013-12-16 13:14:15 UTC
Added explicit conformation if project metadata was changed externally.
Change set:
http://hg.netbeans.org/cnd-main/rev/348a415fc200
Comment 16 Quality Engineering 2013-12-17 03:05:06 UTC
Integrated into 'main-silver', will be available in build *201312170002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/348a415fc200
User: Alexander Simon <alexvsimon@netbeans.org>
Log: fixing Bug #231673 project configuration is not reloaded upon branch swithching.
Comment 17 Alexander Simon 2013-12-19 11:28:01 UTC
fixed, change set:
http://hg.netbeans.org/cnd-main/rev/5036b4eccc05
Comment 18 Quality Engineering 2013-12-24 02:43:30 UTC
Integrated into 'main-silver', will be available in build *201312240002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/5036b4eccc05
User: Alexander Simon <alexvsimon@netbeans.org>
Log: fixed Bug #231673 project configuration is not reloaded upon branch swithching.
Comment 19 soldatov 2014-03-22 08:44:41 UTC
I don't see any regressions in latest test report [NetBeans IDE 7.4 (Build 20140320-3f80b6998498)]
Comment 20 Quality Engineering 2014-03-26 17:06:45 UTC
Integrated into 'releases/release74', will be available in build *201403261440* or newer. Wait for official and publicly available build.

Changeset: http://hg.netbeans.org/releases/rev/32d0711353cb
User: Alexander Simon <alexvsimon@netbeans.org>
Log: fixing Bug #231673 project configuration is not reloaded upon branch swithching.
(transplanted from 348a415fc200eb7dd3b5ceb3a31980a8e7fb8627)
Comment 21 Q-BiC 2014-05-07 14:39:34 UTC
Just tried this. Seems to work as expected, but only when switching branches through netbeans.  When switching branches through command line (with a modified configurations.xml file), the change in the file is not picked up by Netbeans.

Or is this expected behavior?