Java Reference
In-Depth Information
Tracking changes within your project
IDEA
has a unique feature called the File View that lets you easily keep track of
the files managed by source control. Select
Version Control | Show File View
,
and a tool window opens that has a checkbox for each files state as managed by
CVS
. Select the states you're interested in, and
IDEA
filters the view of the project
structure to show only those files. For example, to see all the modified files only,
select the
Modified
option and deselect the others. The view of the project
beneath the options will update with only those folders in the project that con-
tain modified files. You can do the same for all the states managed within the ver-
sion control system.
For
CVS
environments, a handy state to filter the project by is
Merged
with conflicts
. Selecting this option alone shows you the files you're
working on that had an update from another developer, meaning the
merge couldn't be done automatically. These files always need attention,
and this technique is by far the easiest way to find them.
TIP
Committing changes to your project
The previous technique is fine for committing a single file (or set of files), but
more often than not you have several different changes that need to be commit-
ted.
IDEA
provides the
Commit Project
command to do just that. It's also a good
way to see what's changed in the tree, even if you aren't yet prepared to commit
your changes. Select
CVS
| Commit Project
(
Ctrl+K
) to bring up a view of
changes made across the project, as shown in figure 8.13.
The total number of modified files is shown in the lower-left corner of the
Commit Directory
dialog. This list shows all the files that will be affected by a
commit, colored to indicate their status. The one status you may not be familiar
with is
Unknown
, which indicates that a file in the working directory isn't under
CVS
control; this may be
OK
, or it may mean you forgot to add it to
CVS
. If you
need to add it now, right-click the file and select the
Add to
CVS
option. If you
don't want the file to be under version control and wish to ignore its presence,
right-click the file and select the
Ignore
option. This information is stored with
your project. (
IDEA
uses the .cvsignore facility in
CVS
to hide these files.) Alterna-
tively, toggle off the
Show unknown
option to hide all unknown files.
Want to edit your .cvsignore files in
IDEA
? Register .cvsignore as a file
extension for text files.
IDEA
will help you do this the first time you dou-
ble-click a .cvsignore file.
TIP