To open a version not currently in your view from a command prompt using a version-extended path
About this task
Tip: This procedure assumes that if you work
in a snapshot view, the element is loaded in the view.
Procedure
- Start a dynamic view or change to a directory loaded into a snapshot view.
- If a cleartool prompt is not already displayed, display
one. To see the list of versions for an element, type the following command:
cleartool lsvtree element-path
The output of the lsvtree command uses version-extended paths to identify each version.
For example:- On UNIX systems and Linux:
%
cleartool lsvtree prog.cprog.c@@/main prog.c@@/main/0 prog.c@@/main/r1_fix prog.c@@/main/r1_fix/1 prog.c@@/main/r1_fix/2 prog.c@@/main/1
- On Windows systems:
>
lsvtree prog.cprog.c@@\main prog.c@@\main\0 prog.c@@\main\r1_fix prog.c@@\main\r1_fix\1 prog.c@@\main\r1_fix\2 prog.c@@\main\1
- On UNIX systems and Linux:
- You can use standard differences tools or cleartool diff to
compare versions against each other. For example:
- On UNIX systems and Linux:
%
cleartool diff prog.c@@/main/r1_fix/1 prog.c@@/main/1 - On Windows systems:
>
diff prog.c@@\main\r1_fix\1 prog.c@@\main\1
- On UNIX systems and Linux:
- To open a version, do one of the following, depending
on the type of view you use:
- In a snapshot view, you must use the cleartool get command
to copy a version into your view. If your development application relies on
specific file extensions, the -to argument of the get command
must use the required extension. For example, the following command copies prog.c@@/main/r1_fix/1 (on Windows systems: prog.c@@\main\r1_fix\1) to prog.old.c in the current directory:
- On UNIX systems and Linux:
%
cleartool get -to prog.old.c prog.c@@/main/r1_fix/1 - On Windows systems:
>
get -to prog.old.c prog.c@@\main\r1_fix\1
- On UNIX systems and Linux:
- In a dynamic view, you can use this version-extended path just as you would use a
standard path.
For example, in a text editor (on a UNIX system or Linux) or in the Open window of Visual Studio (on Windows systems), you can use the file name prog.c@@/main/r1_fix/1 (on a Windows system: prog.c@@\main\r1_fix\1) to open the first version on the r1_fix subbranch.
Windows tip: You must use backslashes when providing version-extended paths to Windows applications.
- In a snapshot view, you must use the cleartool get command
to copy a version into your view. If your development application relies on
specific file extensions, the -to argument of the get command
must use the required extension.
Results
If your development application relies on specific file extensions, use a standard copy shell command to copy the version-extended path to a file name with the required extension.