In a static view, how can I view an old version of a file?
Given an empty file (called empty in this example) I can subvert diff to show me the old version:
% cleartool diff -ser empty File@@/main/28
This feels like a pretty ugly hack. Have I missed a more basic command? Is there a neater way to do this?
(I don’t want to edit the config spec – that’s pretty tedious, and I’m trying to look at a bunch of old versions.)
Clarification: I want to send the version of the file to stdout, so I can use it with the rest of Unix (grep, sed, and so on.) If you found this question because you’re looking for a way to save a version of an element to a file, see Brian’s answer.
I am not sure if you are speaking about "a bunch of old versions" of one file, "a bunch of old versions" from several files.
To visualize several old versions of one file, the simplest mean is to display its version tree (
ct lsvtree -graph File), and then select a version, right-click on it and ‘Send To‘ an editor which accepts multiple files (like Notepad++). In a few click you will have a view of those old versions.Note: you must have CC6.0 or 7.0.1 IFix01 (7.0.0 and 7.0.1 fail to ‘sent to’ a file with the following error message "
Access to unnamed file was denied")But to visualize several old versions of different files, I would recommend a dynamic view and editing the config spec of that view (and not the snapshot view you are currently working with), in order to quickly select all those old files (hopefully through a simple select rule like ‘
element * aLabel‘)[From the comments:]
The idiomatic way is through a dynamic view (that you configure with the exact same config spec than your existing snapshot view).
You can then browse (as in ‘change directory to’) the various extended paths of a file.
If you want to cat all versions of a branch of a file, you go in:
‘
1‘, ‘2‘, … ‘x‘ being the version 1, 2, … x of your file within that branch.For a snapshot view, the extended path is not accessible, so your "hack" is the way to go.
However, 2 remarks here:
(one line version for copy-paste, Unix syntax:)
(multi-line version for readability:)
(one line version for copy-paste, Unix syntax:)
(multi-line version for readability:)
That way, the output is nicer.
The "
cleartool get" command (man page) mentioned below by Brian don’t do stdout:So maybe than, by piping the result to a
cat(ortypein windows), you can then do something with the output of saidcat(type) command.