Replacing

Suppose after further reflection we realize that the revision of file1.txt that we just received is incorrect and in fact we want an earlier revision. You can replace a Workbench resource with an earlier revision of the resource from the repository. To rollback to an earlier revision:

  1. In the Navigator view select the file1.txt

  2. From the file's context menu, select Replace With > Revision...

  3. In the replace with revision Compare editor that opens, choose the original (bottom-most) revision and, from the popup menu choose Get Contents.

  4. Open the preferences (Window > Preferences) and turn on the CVS label decorations (on page Workbench > Label Decorations and ensure CVS is checked).

    Decorator Preference

    Observe that the Navigator updates to show the CVS state of a resource. Notice that the modified file is preceded by "> (see #1) indicating that we have changed file1.txt (by replacing it with the earlier version). 

    File selection

  5. Now that we have finished our coffee we realize that this older revision is not as good as it initially seemed and in fact the revision in the repository is better after all. 

    Instead of choosing Team > Synchronize with Repository, let's choose Replace With > Latest from Repository. 

    Observe that file1.txt is updated to be the contents from the repository, and that the leading indicator ">" has been removed since we now have the same revision as the repository.

We have seen how to synchronize with the repository, replace with revision or replace with the latest from the repository. You can also compare with these revisions/versions in a similar manner by choosing the  Compare With menu operation from a resource's context menu in the Navigator.

Next topic Versioning your project 

Back to previous topic Committing

  
Copyright IBM Corporation 2000, 2002. All Rights Reserved.