Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 62205
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T18:26:22+00:00 2026-05-10T18:26:22+00:00

In a static view, how can I view an old version of a file?

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T18:26:22+00:00Added an answer on May 10, 2026 at 6:26 pm

    I’m trying to look at a bunch of old versions

    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:]

    what’s the idiomatic way to "cat" an earlier revision of a file?

    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:

    cd /view/MyView/vobs/myVobs/myPath/myFile@@/main/[...]/maBranch cat 1 cat 2 ... cat x 

    ‘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:

    • to quickly display all previous revisions of a snapshot file in a given branch, you can type:

    (one line version for copy-paste, Unix syntax:)

     cleartool find addon.xml -ver 'brtype(aBranch) && !version(.../aBranch/LATEST) && ! version(.../aBranch/0)' -exec 'cleartool diff -ser empty '$CLEARCASE_XPN'' 

    (multi-line version for readability:)

     cleartool find addon.xml -ver 'brtype(aBranch) &&                                 !version(.../aBranch/LATEST) &&                                 ! version(.../aBranch/0)'            -exec 'cleartool diff -ser empty '$CLEARCASE_XPN'' 
    • you can quickly have an output a little nicer with

    (one line version for copy-paste, Unix syntax:)

     cleartool find addon.xml -ver 'brtype(aBranch) && !version(.../aBranch/LATEST) && ! version(.../aBranch/0)' -exec 'cleartool diff -ser empty '$CLEARCASE_XPN'' | ccperl -nle '$a=$_; $b = $a; $b =~ s/^>+\s(?:file\s+\d+:\s+)?//g;print $b if $a =~/^>/' 

    (multi-line version for readability:)

     cleartool find addon.xml -ver 'brtype(aBranch) &&                                 !version(.../aBranch/LATEST) &&                                 ! version(.../aBranch/0)'           -exec 'cleartool diff -ser empty '$CLEARCASE_XPN'' | ccperl -nle '$a=$_; $b = $a;                 $b =~ s/^>+\s(?:file\s+\d+:\s+)?//g;                print $b if $a =~/^>/' 

    That way, the output is nicer.


    The "cleartool get" command (man page) mentioned below by Brian don’t do stdout:

    The get command copies only file elements into a view.

    On a UNIX or Linux system, copy /dev/hello_world/foo.c@@/main/2 into the current directory.

    cmd-context get –to foo.c.temp /dev/hello_world/foo.c@@/main/2 

    On a Windows system, copy \dev\hello_world\foo.c@@\main\2 into the C:\build directory.

    cmd-context get –to C:\build\foo.c.temp \dev\hello_world\foo.c@@\main\2 

    So maybe than, by piping the result to a cat (or type in windows), you can then do something with the output of said cat (type) command.

    cmd-context get –to C:\build\foo.c.temp \dev\hello_world\foo.c@@\main\2 | type C:\build\foo.c.temp  
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 58k
  • Answers 59k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer How are you running the mod_wsgi server? I expect that… May 11, 2026 at 8:55 am
  • added an answer Assuming the ID is unique: var result = xmldoc.Element('Customers') .Elements('Customer')… May 11, 2026 at 8:55 am
  • added an answer Doesn't the OrderBy have to be outside the Where clause?… May 11, 2026 at 8:55 am

Related Questions

No related questions found

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.