How to download a file from ClearCase?

2019-06-05 07:31发布

问题:

Hi ClearCase Experts,

I just want to download a the latest version of a file from Clear Case for which I have the complete path & Clear Case View Name. Also we can safely assume that there is only one branch.

I looked for Clear Tool Commands HERE but, non of them seems useful,for my purpose.

I don't want to do a checkout/check-in etc. I just want the latest version of file. Though, the requirement is fairly simple. I am not able to get this done because I don't see any direct way to do this.

Please Help.

Additional Info: I am using Visual studio 2012(C#,ASP.NET) with Clear Case Addons.

Any help appreciated!!.

回答1:

On way is to use cleartool get.

Use the get command to copy a specified version of a file element into your snapshot view.
You must issue the get command from the root directory of a snapshot view or any directory below it.

Example:

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

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

This is using the ClearCase extended path for accessing a given version, as illustrated in "In ClearCase, how can I view old version of a file in a static view, from the command line?".
That other answer points to a way to access the content of a file with:

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

That would look specifically for the LATEST version of a file on a given branch.