2

I am new to clearcase and I am trying to generate a blame file using annotate command, but I am getting the following error :

cleartool: Error: Not an object in a vob: "App.java"

I followed these steps :

  1. Created a view in clearcase explorer
  2. Browsed to the location (C:\test_view)
  3. Ran: cleartool annotate App.java

This resulted in the following -

cleartool: Error: Not an object in a vob: "App.java".

Eric Renouf
  • 13,950
  • 3
  • 45
  • 67
Akshay jain
  • 555
  • 1
  • 7
  • 22

2 Answers2

1

You cannot execute cleartool commands on elements (versioned files or folder) directly in a snapshot root folder like c:\test_View.

You need to edit its config spec:

cd c:\test_View
cleartool edcs

Add selection rules (like at least element * /main/LATEST, unless this is an UCM view, in which case selection rules are already there), and load rules in order to load at least the content of a Vob.

Then you can go within the vob and do some cleartool annotate.

cd c:\test_view\avob
cleartool annotate afile

Note: if your file App.java is not yet versioned, you would need to add it to source control (in any folder in c:\test_view\avob), with cleartool mkelem, or, for multiple files, clearfsimport.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • when running command cleartool.edcs on c:\test_view getting error: Error: Cannot get view info for current view: not a ClearCase object. – Akshay jain Jun 16 '15 at 13:39
  • my test_view is a web view i have checked it in show properties option of view – Akshay jain Jun 16 '15 at 14:17
  • @akshayjain web view? Are you running ClearCase 8.x and/or CCRC? In that case, replace cleartool with rcleartool (http://stackoverflow.com/a/21577362/6309). Or use the ClearTeam explorer to access the config spec that way. – VonC Jun 16 '15 at 14:37
  • i tried the command cleartool annotate filename and now the error is could not find the path of the file. this vob is public and is on some other machine. @Vonc i am using clearcase 8.0.0 version – Akshay jain Jun 16 '15 at 16:35
  • @akshayjain see also http://stackoverflow.com/a/13286838/6309. What version of ClearCase are you using? What is the exact full complete command that you have typed? – VonC Jun 16 '15 at 16:37
  • i am using clearcase veriosn 8.0.0 and the command i have typed 1.cleartool annotate App.java and 2.cleartool annotate App.java – Akshay jain Jun 16 '15 at 16:47
  • @akshayjain `cleartool annotate/clinical` would not work: you don't add a vob tag to a command. `cleartool annotate App.java` would work if `App.java` has been added to source control in a Vob (like `/clinical`). What is your current path when you type that command? What `cleartool ls` returns? – VonC Jun 16 '15 at 16:54
  • cleartool ls returining cleartool: Error: Pathname is not within a VOB: "." – Akshay jain Jun 17 '15 at 05:56
  • I read your ans cleartool ls :Error but when i trying cleartool setview test_view is giving error cleartool: Error: Unrecognized command: "setview" – Akshay jain Jun 17 '15 at 06:14
  • @akshayjain setview is for dynamic view only, which are not supported in Cleartool 8.0.0. And a view on `C:\` is not a dynamic view anyway. It is a snapshot view or a web view (CCRC). – VonC Jun 17 '15 at 06:32
  • @akshayjain cleartool ls only works in a vob within a view: `c:\test_view\avob\...`. – VonC Jun 17 '15 at 06:32
  • i have created a dynamic view and i have created vobs which are showing under that view now how to add the code in the vobs and then annotate them. here the path is where i am Y:\test_akshay> here y is my view and test_akshay is my vob now how to add file and folders in this vob – Akshay jain Jun 17 '15 at 09:28
  • @akshayjain Great! But don't bother with setview. Use the full path of the dynamic view: `M:\myView\avob\...` – VonC Jun 17 '15 at 09:33
  • is there a way to apply annotate and lshistory command on web view?? – Akshay jain Jun 22 '15 at 04:23
  • @akshayjain yes, with rcleartool I mentioned above in the comments, and in http://stackoverflow.com/a/21577362/6309. – VonC Jun 22 '15 at 05:53
0

Please create VOBs through create VOB program.

Then create dynamic view using clearcase explorer.

Mount the VOBs on the dynamic view.

Once mounted, in the view explorer, right click and add text file.

rt-click text file to add to source and then checkin the file after making the necessary changes.

from command prompt go to the VOB and run cleartool annotate

Z:>cd test_tut_element_vob

Z:\test_tut_element_vob>cleartool annotate TestFile.txt Annotated result written to "TestFile.txt.ann".enter image description here

Saurabh Juneja
  • 1,187
  • 1
  • 8
  • 12