About CVSCVS (Concurrent Version System) is a type of version control system that aids developer groups working with shared source files in common repositories by managing file revision history information.
The IDE's CVS built-in support enables you to manage changes to version-controlled files as you work. In the IDE, you can call CVS commands on both files and directories in the Projects, Files, Versioning, and Favorites windows. For an overview of the typical workflow when using CVS in the IDE, see Working with CVS.
The IDE's CVS ToolsThe IDE provides several tools to simplify the process of working with version-controlled files, including:
- Versioning Window. Provides an interface displaying local changes in version-controlled files.
- Search History Window. Enables you to search for specific revisions of version-controlled files.
- Graphical Diff Viewer. Enables you to graphically compare differences in file revisions.
- Merge Conflict Resolver. Assists you in resolving conflicts that occur when committing conflicting file versions to the repository.
- Output Window. Provides an automatic monitoring view of active VCS operations.
CVS Visualization FeaturesThe IDE provides several file status information tools that simplify the process of working with version-controlled files, including:
- Color Coding. Enables you to view the current status of version-controlled files.
- Annotations. Enables you to view revision and author information for each line of version-controlled files.
For further documentation on the IDE's CVS support, see the following resources:
NetBeans IDE CVS Support Home:
http://javacvs.netbeans.org/Preview of CVS Support in NetBeans IDE:
http://www.netbeans.org/kb/60/ide/cvs.htmlUsing CVS with the IDEThe IDE's CVS support enables you to manage the evolution of changes in version-controlled files by displaying status information directly in the IDE's various windows (e.g. Projects, Files, Favorites, Versioning) so that you can call CVS commands as you work.
Tracking Changes in the Versioning WindowThe Versioning window presents a real-time view of the changes in selected directories. It opens at the bottom of the IDE whenever you view changes made in version-controlled files. By default, the Versioning window displays a list of all modified files within the selected package or folder.
You can open the Versioning window by choosing Versioning > CVS > Show Changes from the main menu. Alternately, you can right-click any versioned project, directory, or file and choose CVS > Show Changes.
Using the filter buttons in the toolbar, you can limit the list of displayed files to either locally or remotely modified files. The Versioning window toolbar also includes buttons that enable you to invoke the most common CVS tasks on all files displayed in the list, such as committing, updating, refreshing status, and performing diff's.
The following CVS commands are available in the Versioning window's toolbar:
| Name | Function |
| Refresh Status | Refreshes the status of the selected files and folders. Files
displayed in the Versioning window can be refreshed to reflect any
changes that may have been made externally. |
| Diff All | Opens the Diff Viewer providing you with a side-by-side comparison of
your local copies and the versions maintained in the repository. |
| Update All | Updates all selected files from the repository. |
| Commit All | Enables you to commit local changes to the repository. |
Calling Version Control CommandsYou can call CVS commands on versioned-controlled files (those existing within a registered working directory) using the CVS menu in the IDE's main window. In addition, many CVS commands are available in the context-sensitive menu for a selected file or directory.
You can access the CVS commands context-sensitive menu by right-clicking a file or directory in any of the following:
- Projects window
- Files window
- Favorites window
- Versioning window
- History Viewer
- Source Editor (i.e. from the tab of an open file)
The IDE's status bar, located in the bottom right of the interface, displays the current command's status.
CVS Tasks: Quick ReferenceThe following table describes common CVS tasks.
| To perform this task | Follow these steps |
| Check out sources | - Choose Versioning > CVS > Checkout from the main menu.
- In the CVS Checkout wizard, specify the location of the CVS repository, enter your password and proxy (if required), and click Next.
- Specify the module and branch you want to check out in the Module and Branch fields, respectively.
- In the Local Folder field, specify the location on your computer where you want the checked out sources to reside.
- Click Finish to check out the files.
|
| View versioning information | - Select a project, directory, or file that is in a CVS working directory
- Choose CVS > Show Changes from the right-click menu. The Versioning window opens to display versioning information on the selected item(s).
|
| Update local file versions | - Select the project, file, or folder that you want to update
- Choose CVS > Update from the right-click menu.
|
Diff files
| - Select the file that you want to perform a diff on.
- Choose CVS > Diff from the right-click menu.
|
Commit local changes
| - Select the file or directory that you want to commit.
- Choose CVS > Commit from right-click menu.
|
Switch to a branch
| - Select the file or folder you want to be the root of your branch and choose CVS > Switch to Branch from the right-click menu.
- In the Switch to Branch dialog, enter a Branch name or click Browse to see a list of available branches.
- Click Switch.
|
| Create a branch | - Select the file or folder and choosing CVS > Tag.
- Enter the tag name in the text field or click Browse to choose from a list of existing tags.
- If you want to ensure that the tag is not attached to local revisions that are out of date, select the Avoid Tagging Locally Modified Files checkbox.
- If you want to move an existing tag to the current revision in your local working directory, select the Move Existing Tags checkbox.
- If you want to remove the specified tag from the selected item, select the Delete Tag checkbox.
|
| Merge revisions | - Select the files or folders that you want to merge into your local working copy and choose CVS > Merge Changes from Branch from the right-click menu.
- Specify whether to start the merge from the branch root, or from a specific revision or tag.
- Specify the end point of the merge (i.e. either the trunk a branch head, or until a specific branch or revision.
- Select the Tag trunk after Merge checkbox if you want to specify a tag for the merged item.
- Click Merge.
|
| Create a patch | - Select the locally modified file or folder and choose Versioning > Export Diff Patch from the main menu.
- Enter a name for the patch file and specify the location where you want to save the patch.
- Click Export.
|
| Apply a patch | - Select the locally modified file or folder and choose Versioning > Apply Diff Patch from the main menu.
- Type the path or navigate to the patch file you want to apply.
- Click Patch.
|
Checking Out Files from a Remote Repository (CVS)In order to work on shared files located in a remote repository, you need to copy the necessary files and directories to your local working directory. This is done by checking out the files from the repository.
To check out files from a remote repository:- Choose Versioning > CVS > Checkout from the main menu.
- On the first page of the CVS Checkout wizard, specify the location of the CVS repository by choosing it from the CVS Root drop-down menu. If you are unfamiliar with the syntax, you can click the Edit button and enter the required information using the dialog. For information on supported CVS protocols, view supported CVS root types below.
- Enter your password in the Password field.
- If you are using a proxy, click the Proxy Configuration button and enter the required information. Click Next.
- On the Module to Checkout page, specify the modules you want to check out in the Module field or click the Browse button to choose from a list of all modules in the repository. Note that if you do not specify a module, the entire repository will be checked out.
- If you need to specify a specific branch, revision number, or tag for the checkout, enter the information in the Branch field or click the Browse button to choose from a list of all branches in the repository.
- Specify the local working directory into which you want to check out the selected modules or branches. Alternately, you can click the Browse button to navigate to the desired directory on your system.
- Click Finish to check out the files. The IDE initiates the check out command and the IDE's Status bar, displayed in the lower right corner of the IDE, indicates the progress of the files downloading from the repository to your local working directory.
If the checked-out sources contain a project, a dialog will appear prompting you to open them in the IDE. If the sources do not contain a project, the dialog will appear prompting you to create a new project from the sources and then open them in the IDE.
The IDE directly supports the following CVS root types:- pserver. For connecting to pserver repositories. :pserver:username@hostname:/repository_path
- ext. For connecting to CVS repositories using SSH, etc. :ext:username@hostname:/repository_path
The following root types require an external CVS executable:
- fork. For protocol access to local CVS repository :fork:/repository_path
- local. For direct access to local CVS repository :local:/repository_path
-- Wagner R. Santos - 20/10/2008