Netbeans & Mercurial - Project Tree Not Updating with Pull

187 views Asked by At

I use Netbeans (7.3), Mercurial, and BitBucket (BB) for personal version control and backup, and also as a way to switch between my work laptop and home desktop. I'm still learning Mercurial, so I created a C++ test project in Netbeans on my desktop and created the BB repository. On my desktop, I init the Mercurial project, commit, and push to my default BB repo, all using Netbeans's GUI commands (no command line Hg commands). My project consists of main.cpp, Person.h, and Person.cpp, where I do some trivial object creation and "cout" to print some strings (print name of Person, "Dave").

On my laptop, I clone the repo from BB to a local directory and open the project in Netbeans. I get the three files as part of my Netbeans project. Now I create a new object, Computer.h and Computer.cpp, and I commit/push to BB... five .h/.cpp files all total in my Netbeans project now.

Back to the desktop: inside Netbeans, I "Pull from Default" and then "Update". When I do this, I can see (Windows explorer) that the new Computer.h/.cpp files were pulled down into the directory, and my main file now shows the changes using the Computer object (print name of Person, "Dave", and name of Computer, "Hal"). The problem is, even though my main file is up-to-date and my project compiles and behaves like it should with the new code, my Netbeans project tree does not show the new Computer.h/.cpp files. I have to "Add Existing Files..." manually to get the new files into the project tree. It's fine when I only add one or two files at a time, but I have a bigger project with a lot more source files, and I can't keep up with how the project tree changes. How can I get the Netbeans project tree to update and reflect the actual file changes that have taken place (additions and deletions to project)? Thanks in advance!

1

There are 1 answers

0
Steve Barnes On

Ensure that your netbeans is configured to store the project file membership under the source directory for your project, (probably in a nbprojects sub-directory), and add some or all of the files in that to your project, (I would look for the file that lists the project members only).

N.B. you will either have to ensure that netbeans is using relative paths or that you have the same paths on both machines, (preferably the former).