Skip to Content

How to Find Modified Files in ClearCase

Learn how to find modified files in ClearCase using the Find Modified Files command, the cleartool lshistory command, and the cleartool deliver -preview command.

ClearCase is a software configuration management tool that allows you to manage changes to your source code and other development assets. It supports parallel development, secure version management, and reliable build auditing. However, sometimes you may want to see what changes you have made to the files in your ClearCase view before committing them to the repository.

How to Find Modified Files in ClearCase

In this article, we will show you how to find modified files in ClearCase using three different methods: the Find Modified Files command, the cleartool lshistory command, and the cleartool deliver -preview command.

Method 1: Find Modified Files Command

The Find Modified Files command is a graphical user interface (GUI) tool that you can access from ClearCase Explorer or from the context menu of a folder or a VOB. It allows you to find all the files that have been modified, checked out, hijacked, or added since a specified baseline or date. You can also filter the results by file name, file type, or activity. To use the Find Modified Files command, follow these steps:

  1. Right-click the base of the tree, and choose Find Modified Files.
  2. In the Find Modified Files dialog box, select the scope of the search. You can choose to search the current folder, the current VOB, or the entire view.
  3. In the Compare Against section, select the baseline or the date that you want to compare your files with. You can also select the Latest Baseline option to compare your files with the most recent baseline in your stream.
  4. In the Filter section, specify any criteria that you want to apply to the search results. You can filter by file name, file type, or activity. You can also use wildcards to match multiple files or activities.
  5. Click Find. The search results will be displayed in a new window, showing the file name, the status, the version, the activity, and the date of each modified file. You can also double-click a file to open it in a diff tool or a text editor.

Method 2: cleartool lshistory Command

The cleartool lshistory command is a command-line tool that allows you to list the event records of a file, a folder, a VOB, or a view. It shows the operations that have affected the data, such as creation, deletion, check-in, check-out, label, attribute, or hyperlink. You can use the cleartool lshistory command to find modified files in ClearCase by specifying the -since option, which filters the event records by date. To use the cleartool lshistory command, follow these steps:

  1. Open a command prompt and set your view using the ct setview command.
  2. Navigate to the folder or the VOB that you want to search.
  3. Type the following command: cleartool lshistory -since date -fmt format
  4. Replace date with the date that you want to compare your files with, in the format YYYY-MM-DD. For example, 2023-11-29.
  5. Replace format with the format that you want to display the event records, using the format specifiers listed in the cleartool lshistory man page. For example, “%n %d %o %u %e\n” will display the file name, the date, the operation, the user, and the event type of each event record.
  6. Press Enter. The search results will be displayed in the command prompt, showing the event records of the modified files since the specified date.

Method 3: cleartool deliver -preview Command

The cleartool deliver -preview command is a command-line tool that allows you to preview the deliver operation from a child stream to a parent stream. It shows the undelivered activities and the versions on those activities, regardless of the component. You can use the cleartool deliver -preview command to find modified files in ClearCase by specifying the -long option, which displays the full path name and version number of each version. To use the cleartool deliver -preview command, follow these steps:

  1. Open a command prompt and set your view using the ct setview command.
  2. Navigate to the folder or the VOB that you want to search.
  3. Type the following command: cleartool deliver -preview -long
  4. Press Enter. The search results will be displayed in the command prompt, showing the undelivered activities and the versions on those activities.

Frequently Asked Questions (FAQs)

Question: How can I compare two versions of a file in ClearCase?

Answer: You can use the cleartool diff command to compare two versions of a file in ClearCase. You can specify the file name and the version selectors of the two versions that you want to compare. For example, cleartool diff -graph file.txt@@/main/branch1/2 file.txt@@/main/branch2/3 will compare the second version on branch1 with the third version on branch2 of file.txt using a graphical diff tool.

Question: How can I undo the changes that I have made to a file in ClearCase?

Answer: You can use the cleartool uncheckout command to undo the changes that you have made to a file in ClearCase. You can specify the file name and the -keep or -rm option to keep or remove the modified file. For example, cleartool uncheckout -rm file.txt will undo the changes and remove the modified file.txt from your view.

Question: How can I commit the changes that I have made to a file in ClearCase?

Aswer: You can use the cleartool checkin command to commit the changes that you have made to a file in ClearCase. You can specify the file name and the -c option to add a comment to the new version. For example, cleartool checkin -c “Fixed a bug” file.txt will commit the changes and create a new version of file.txt with the comment “Fixed a bug”.

Summary

In this article, we have shown you how to find modified files in ClearCase using three different methods: the Find Modified Files command, the cleartool lshistory command, and the cleartool deliver -preview command. These methods can help you to review your changes, compare your files, and prepare for a deliver operation. We hope that this article has been helpful and informative for you. If you have any questions or feedback, please feel free to leave a comment below.

Disclaimer: This article is for informational purposes only and does not constitute professional advice. The information and opinions expressed in this article are those of the author and do not necessarily reflect the official policy or position of IBM or any other organization. The author is not responsible for any errors or omissions in this article or for any damages arising from the use of this article. The user is solely responsible for verifying the accuracy and validity of the information and commands in this article before applying them to their own situation. The user should also consult the official documentation and support resources of ClearCase and other related tools before using them.