1

I have file path in ClearCase repository: DWH/MSL/MAPP/META/SP.sql@@/main/10.

I have repository https path which is used for Remote Client:

http://clearcase.net:12080/TeamWeb/services/Team

I need to download the file from the repository. How can I do this?
I've tried to read CC manuals and cleartool manuals but unfortunately it's still not clear.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250

1 Answers1

1

That looks like a CCRC url (ClearCase Remote Client: see the feature comparison matrix with ClearCase).

That means you need to create a web view first.
See "About ClearCase views": if you are using ClearCase 8.x, you also can define dynamic views (if you have the full ClearCase client installed on your post).

Once that view loaded (for web views), you will get the file you want on your disk, provided your config spec does select the version you mention.

For ClearCase 8, you would use in a script the rcleartool API, as mentioned in "How to use CCRC to get prievous file version?".
That allows for using rcleartool get in roder to get directly a version of a file, from a specific view (meaning you still need to create a view first).

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • How to create WEB view? And is there a way to do it without creation of local objects... For example what to do if I have perl program that has to download files from CC repository. If this program is used on different PCs should the view be created on each PC then? Isn't that ugly? – user2125060 Apr 16 '14 at 10:22
  • @user2125060 mainly through a CCRC GUI. Or through the command-line http://www-01.ibm.com/support/docview.wss?uid=swg24021929 (mkview) and mention in http://stackoverflow.com/a/22146929/6309. What ClearCase version are you using? – VonC Apr 16 '14 at 10:34
  • I am using 7.1.2. But what is strange for me is that I need to create a view to access the file, however I have all information about it without this view. – user2125060 Apr 16 '14 at 12:58
  • In CCRC I already have snaphot views -are these what you call WEB views? In CCRC I can't see any option to create WEB view... Could you please help with this? Thanks. – user2125060 Apr 16 '14 at 12:59
  • @user2125060 yes, CCRC "snapshot" views are actually called "web views". But I don't think CCRC 7.x has a `rcleartool get`. And it definitively does not support dynamic view. – VonC Apr 16 '14 at 13:02
  • @user2125060 your best bet is to ask for the installation of a full ClearCase client. CCRC is not a good fit for what you want to do. – VonC Apr 16 '14 at 13:04
  • OK. I've downloaded rcleartool set SHARED and JAVA path variables. Now when I submit get command in rcleartool I receive a message: CRCLI1009E Unrecognized command: "get". What am I doing wrong. And why is it so difficult to simply download file from ClearCase repository? Thanks. – user2125060 Apr 16 '14 at 18:55
  • @user2125060 yes, that is what I was saying above: such an old ClearCase version has not yet the '`get`' command in `rcleartool`. – VonC Apr 16 '14 at 18:55
  • But I've downloaded ccrccli_8.0.0.2 and it also doesn't work... Probably it is trying to use some API from the Remote Client which is of old version. Another question - how does Remote Client downloads files from repository. In my situatiation - is the only way to download file from repository using command line is through Dynamic View? Thanks. – user2125060 Apr 16 '14 at 19:39
  • @user2125060 yes, a more recent `rcleartool` wouldn't work with an older CCRC server. You can download files when you create and then update your web view, very much like a regular snapshot view. You don't have access to dynamic view here. – VonC Apr 16 '14 at 19:49
  • OK, can I create a view to only contain one file? could you please share config for that. For example if the file is located in: DWH/MyFolder/MyFile.sql@@/main/my_branch/2 Thanks – user2125060 Apr 16 '14 at 19:53
  • @user2125060 the config spec is the same. At the end, though, you can add **load** rules: `load /path/to/your/file`: That way, your config spec will select a lot of files version, but will actually load only one file. – VonC Apr 16 '14 at 19:54
  • What I need is ability to download files. If I can't use get command with rcleartool then the idea is to create temporary view with only one file (and selected version), copy the file and drop the view. If you can share the create view config for the specified version file you will save a lot of my time. Thank you for understanding. – user2125060 Apr 16 '14 at 19:57
  • 1
    @user2125060 nothing special about the config spec. Probably (if your file is in branch main: `element * /main/LATEST` followed by `load /DWH/MyFolder/MyFile.sql` – VonC Apr 16 '14 at 19:59
  • How can I specify the version of file to load? I've tried to use /main/4 but it throws an error. – user2125060 Apr 16 '14 at 20:31
  • @user2125060 put *before* `element * /main/LATEST` a selection rule `element /DWH/MyFolder/MyFile.sql /main/4` – VonC Apr 16 '14 at 21:01
  • Yes, this works thank you. Another question: if I use use sub branch, why do I need to put following line in version selection: element * START_MYBRANCH_BRANCH where MYBRANCH is branch name? – user2125060 Apr 16 '14 at 21:40
  • @user2125060 if the version is on a sub-branch, the proper syntax is `element /DWH/MyFolder/MyFile.sql .../MYBRANC/4`. Note the three dots. – VonC Apr 16 '14 at 21:42
  • Here is my config: element * CHECKEDOUT element /DWH/FOLD/APP/Work/CMP.vw .../mybranch/4 element * .../mybranch/LATEST element * START_mybranch_BRANCH. If I remove the last element option then Remote Client throws exception: Problems performing setcs. ClearCase CM Server: Error: Unable to determine version for VOB root directory element. ClearCase CM Server: Error: Unable to access "\DWH\FOLD\APP\Work\CMP.vw": No such file or directory. ClearCase CM Server: Error: 1 config spec load rule problems encountered. It is not a problem to add it in a program, but I don't understand why it is needed – user2125060 Apr 16 '14 at 21:58
  • And finally, could you please point me how to create snapshot view using cleartool or rcleartool with all settings I used in remote client. Thanks a lot for help – user2125060 Apr 16 '14 at 22:09
  • 1
    @user2125060 the path in a selection rule should be `/yourVob/path/to/your/file` (or `/vobs/yourVob` if you are on unix, which could be the case considering the web views are interpreted on the CCRC server, which is usually on Linux/Unix, so try both) – VonC Apr 17 '14 at 05:26
  • @user2125060 simply create a view with the GUI, and use that one. Per script, it is `rcleartool mkview` (http://pic.dhe.ibm.com/infocenter/cchelp/v8m0r1/index.jsp?topic=%2Fcom.ibm.rational.clearcase.cc_ref.doc%2Ftopics%2Fct_mkview.htm). To change the config spec of a view per script: `rcleartool setcs` http://pic.dhe.ibm.com/infocenter/cchelp/v8m0r1/index.jsp?topic=%2Fcom.ibm.rational.clearcase.cc_ref.doc%2Ftopics%2Fct_setcs.htm – VonC Apr 17 '14 at 05:29
  • To create a view using GUI is not an option as view must be created based on the input file. I.e. user supplies file with full path, branch and version and this file must be downloaded to the local machine and some work done. – user2125060 Apr 17 '14 at 07:22
  • Ok. The idea is first - create a view, then - modify config. Should anything else be done before the files will be loaded from the server? What I can't find in the manual is how to create config file. There is no even sample config file. Thanks! – user2125060 Apr 17 '14 at 07:35
  • 1
    @user2125060 ok, then `rcleartool mkview` is the way. – VonC Apr 17 '14 at 07:35
  • @user2125060 No. Actually, creating the view will try to load (but since the default config spec has no loading rule, it won't load anything). Then you change the config spec with your selection rules *and* load rules, and the view will load. – VonC Apr 17 '14 at 07:37
  • @user2125060 I mention that config spec a few comments back (http://stackoverflow.com/questions/23105722/clearcase-get-file-from-repository/23106205?noredirect=1#comment35343027_23106205). You need to debug the path issue though (http://stackoverflow.com/questions/23105722/clearcase-get-file-from-repository/23106205?noredirect=1#comment35354140_23106205) – VonC Apr 17 '14 at 07:44
  • Bad news. I am using rclearcase of version 7.1.2 and there is no setcs command. I.e. there possibility how to create a view but no possibility how to modify config file. It's not logical! Can I specify config file during the view creation? To use version 8.* of the client is not an options as server doesn't support it... I just don't understand why to create view if you can't specify it's config... – user2125060 Apr 17 '14 at 09:13
  • @user2125060 It seems the client is not the right place to do what you want. You might need to distribute the process of retrieving the process to a server which has a full ClearCase installation and can easily get any version would want. By distribute, I mean access a script on a shared path, in a machine with a full ClearCase, which would return on that same shared path the expected content. – VonC Apr 17 '14 at 09:21
  • @user2125060 7.1.2 was amongst the first versions where CCRC was being implemented: it was quite incomplete back then. (and by "back then", I mean October 2010) – VonC Apr 17 '14 at 09:22
  • But wait, isn't it strange that from the client I can't download the file I want. And how in this case Remote Client creates the view? Something is missing here... – user2125060 Apr 17 '14 at 09:23
  • @user2125060 no, it isn't strange. CCRC isn't meant to do that. It is meant to provide a light-way access to use ClearCase views without having ClearCase installed. You might simulate what you want with CC 8.x, but not 7.x. – VonC Apr 17 '14 at 09:25
  • I've made some google search and found that there is something called CAL - programming api for clearcase. Is it possible to create view using CAL and Perl? Any examples? Thanks. – user2125060 Apr 17 '14 at 11:16
  • @user2125060 yes, but I don't think it is compatible with CCRC. See for instance my answers at http://stackoverflow.com/a/1193934/6309, http://stackoverflow.com/a/831673/6309, and especially http://stackoverflow.com/a/8400960/6309 (but that calls `cleartool` in the background, meaning it relies on a full ClearCase, not a light-weight client asking a CCRC server). All examples at http://stackoverflow.com/search?q=user%3A6309+cal – VonC Apr 17 '14 at 11:18