Working with Versioning Histories


When working with a long-running development project, managing long versioning histories and multiple branches can get very tricky. You often have to roll back changes that introduce bugs or have to merge a specific set of changes from one branch to another. The IDE's Search History window gives you a powerful tool for viewing and searching through branches and past revisions of your files.

Viewing the History of a File

To view the full history for a file, right-click the file's node and choose CVS | Search History. The Search History window, shown in Figure 4-7, displays all of the file's revisions. You can click the Diff button to view diffs of the various revisions. Select any one revision to diff it against the copy in your working directory. Select any two revisions to see the differences between the two revisions.

Figure 4-7. Search History window


Searching for a Commit

When you need to roll back a change or create a patch from a commit, it is necessary to find all the files that were included in the commit. Doing this is fairly difficult from the command line, since regular CVS has no way to search for a particular commit message. The Search History window makes the process of finding an entire commit painless.

To find all the files that were included in a commit:

  1. Make sure that all the projects on which you ran the commit command are open in the IDE.

  2. Right-click any file that you know was included in the commit and choose Search History. All of the file's revisions are displayed in the Summary view.

  3. Find the revision that was created by the commit and click Find Commit in Open Projects.

  4. The IDE opens a second Search History window listing all the files included in the commit. You can switch to the Diff view to see the differences of each file, or choose CVS | Export Search Details Diff Patch to capture the commit changes in a patch.

Reversing Changes in a File

If you have made changes to a file that you would you like to reverse, you can easily do so:

  • If the changes you would like to reverse have not yet been committed to the repository, you can use the Revert Modifications command to overwrite your local copy of the file with the current repository version of the file.

  • If you want to reverse changes to a file that you have already committed to the repository, you can use the Roll Back command to reinstate a previous version.

To revert local modifications, right-click the file and choose CVS | Revert Modifications.

To revert changes that have already been committed to the repository:

  1. Right-click the file and choose CVS | Search History. All of the file's revisions are displayed in the Summary view.

  2. Find the revision to which you would like to revert. Within the Summary view, you can display diffs to inspect the differences between the various revisions.

  3. Right-click the revision to which you would like to revert and choose Rollback to RevisionNumber.

    After you run this command, your local copy is reverted to the previous revision, but the repository copy is not changed.

  4. Right-click the file's node and choose CVS | Commit.

    The reversal of the changes is committed to the repository (and the revision number is incremented upwards).



NetBeans IDE Field Guide(c) Developing Desktop, Web, Enterprise, and Mobile Applications
NetBeans IDE Field Guide(c) Developing Desktop, Web, Enterprise, and Mobile Applications
ISBN: N/A
EAN: N/A
Year: 2004
Pages: 279

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net