Advanced Versioned Sources Synchronization
This guide describes how to synchronize your working directories with
versioning repository, using features available in NetBeans IDE 4.0 and 4.1.
Currently most users mimic sequence of basic versioning system commands, in the
IDE exposed as 1:1 actions, that gain high visibility and can be easily found.
Recent survey shows
clear requirement for better edit, update, diff and commit task-based
workflow and project's integration. A dedicated Synchronize project
view is under development.
Meanwhile, described approach can be used to simulate its functionality.
Once that is finished, this guide will no longer be needed.
Unleash Find
The idea of higher-level synchronization is based on
Find action
advanced criterion. This criterion appears only when it's invoked for a versioned
directory, for example, in
Files explorer.
Switch to Files view then select project or arbitrary directory
you want to synchronize and from context menu choose Find action.
Then select Status criterion tab and customize it to match:
- for CVS Up-to-Date and Ignored
- for VSS and PVCS Current and Ignored
- for SVN Up-to-Date and Ignored (TODO and probably
Merged and Unversioned but used, solving with author)
file statuses.
There is no status criterion support for ClearCase, Perforce,
TeamWare/SCCS and StarTeam versioning systems, yet.
Next revert the criterion (to match all out-dated
and unversioned/local files) by clicking on check-box under
the list.
You can Save Settings As... the criterion for further retrieval.

Next time you can reload the criterion using
Restore Saved...
button.
Finally start the search. The Search results window
opens. Wait until the search has finished. Now you can see all
files that needs your attention.
Resolve Differences
In the
Search results window select files that are suspicions or that you want to recheck.
You can select multiple files by using
Shift and
Ctrl modifiers. The context menu offers
all the actions, including versioning actions, that can help to resolve differences.
The action you must take to resolve differences depends on versioning system
and on what you want. Few examples for CVS versioned files follow:
- Local files can be either Ignored or scheduled for Add to
repository.
- Needs Update files can be either Removed or Updated (the project
may then need to be recompiled).
- Merge Conflicts files must be Opened in editor,
the conflict manually resolved and then Updated to be sure the conflict has been removed. You can also discard
your changes by Update in advanced mode (push Ctrl modifier while choosing the action)
and checking Get Clean Repository Copy check-box.
- Locally Modified files must be checked to see whether the file really contains wanted Difference.
You can rollback local changes by getting clean repository copy (described above).
- etc.
Commit Changes
Locally Modified,
Locally Added and
Locally Removed files can
be committed directly from the results view. However, because commit/check-in atomicity is
often required, after you have resolved all issues, you should perform the
Commit action
directly on the working directory. This way, the underlying versionig system confirms that you
have resolved all the necessary differences.
Note that some systems such as CVS does not support true atomic commit
by nature. Still you should use suggested approach because it at least
minimizes repository inconsistency chance caused by concurrent commit.
Tear Off
The article shows alternative approach for synchronizing versioned folders.
You can mail author if you discover procedure enhancements or deficiencies.
Updated on Feb 22th 2005
Petr Kuzel (
pkuzel)