当前页面: 开发资料首页 → Netbeans 专题 → Guided Tour of the New NetBeans CVS Support
摘要: This document gives you a quick overview of the new redesigned CVS features for the NetBeans IDE. The CVS support was redesigned to focus on the user tasks you perform most often and especially to be integrated with the IDE's project system.
Note: Both the NetBeans development builds and the new CVS support are in a very early stage of development. They could therefore contain bugs that can lead to data loss and should never be used for production sources. This release is meant only to preview the functionality and collect user feedback.
The new CVS support is available in the development builds only. It is not available for NetBeans 4.1. You can download a development build here.
Since the new CVS support and the NetBeans 4.1 versioning systems are incompatible, the 4.1 versioning modules have been moved to the Update Center. This means that the development builds do not contain any support for other version control systems, such as Microsoft Visual SourceSafe and Subversion. You can download the 4.1 versioning modules by choosing Tools > NetBeans Update, connecting to the Development Update Center, and downloading all of the modules under Version Control.
For the upcoming NetBeans release, only CVS will be implemented in the new design. Subsequent releases will implement other version control systems as well.
This part is easy you don't have to do anything. The IDE automatically scans your open projects and, if they contain CVS directories, shows the CVS status for the files and offers the full CVS menu of commands.
If you don't have the sources for your project checked out yet, you can do so in the IDE:
The IDE gives you several ways of viewing status information about your files:
The IDE uses the badges and coloring in the following table to show status of files, folders, packages, and projects.
UI | Description | Meaning |
---|---|---|
![]() |
Blue badge on folder or package node | Marks folders or packages that contain locally modified or new files. In case of packages, this badge applies only to the package itself and not its subpackages. For regular folders, the badge indicates presence of local modification in that folder or any of its subfolders. |
![]() |
Red badge on folder or package node | Marks folders or packages that contain conflicting files (local conflicts). In case of packages, this badge applies only to the package itself and not its subpackages. For regular folders, the badge indicates presence of local modification in that folder or any of its subfolders. |
![]() |
Blue label | Indicates that the file has been changed locally. It has been either modified or it is a new file |
![]() |
Red label | Indicates that the file contains conflicts (sections marked with <<<<< and >>>>>). You will want to invoke the CVS/Resolve conflicts command on such files. |
![]() |
Gray label | The file is ignored by CVS and will not be part of any versioning commands (update, commit, etc). |
![]() |
Light blue label | Indicates, that the file has been modified in repository. It has been newly added, modified or deleted. |
![]() |
Strikethrough label | The file is excluded from all commit operations. |
The Versioning window has been totally reworked in the new CVS support. It now presents a real-time view of the changes in selected directories. For example, right-click any project that is in a CVS working directory and choose CVS > Show Changes. The following window appears in the bottom of the IDE:
The Versioning window lists the following:
As you work with your files, the Versioning window is automatically updated to show which files have changed. In the window, you can do any of the following:
There are three ways to generate diffs in the IDE:
The IDE displays your diffs in the Diff Viewer, which opens as a tab in the Source Editor. Like in NetBeans 4.1, the Diff Viewer shows the working copy of the file in the left panel and the repository copy in the right panel. In the new CVS support, the viewer also shows the diffs for multiple files in one tab. You can switch between files using the combo box. You can also filter the diffs to show only changes you have made locally or changes made in the repository.
Updating and committing files are the most common activities you perform with CVS. The IDE makes these actions as easy as possible. You can launch these actions from the main IDE navigation windows (Projects, Files, and Favorites) or from the Versioning window.
Updating files is easy:
Like updating files, you can commit files from the Projects window (right-click
and choose CVS > Commit), from the Versioning window (using the
button), or from the CVS menu (commits all changes in all open projects).
When you run the Commit command, you see the following dialog:
The Commit dialog lists:
The IDE automatically suggests adding all local files to the repository when you run the commit command on a folder. It is therefore important to tell the IDE which files to ignore. You can ignore files in two ways:
The new CVS support makes it even easier to share your project metadata so that you can share not only your sources, but your IDE settings as well. The IDE automatically excludes your build, dist, and nbproject/private directories from check-in.
All of your project settings are stored in your build.xml file and the files in your nbproject directory. When you run the Update or Commit commands on a project node in the IDE, both your sources and your project settings are updated or committed. If you just want to run CVS commands on project settings, go to the Files window, right-click build.xml and nbproject, and choose CVS > Update or CVS > Show Changes. Likewise, if you just want to perform CVS commands on your sources, it is best to run the Show Changes command on the source folders in the Files window or source package nodes in the Projects window, then update or commit from the Versioning window.
If you have a local project, you can quickly put it into CVS: