Clicky

In CVN, we can view which who wrote which line of code in a procedure.

The whole procedure opens up with line numbers along with the name/id of person who wrote it.

How can i do this in Clearcase

asked 05/19/2011 03:58

gram77's gravatar image

gram77 ♦♦


11 Answers:
cleartool annotate

annotate
link
JIEXA's gravatar image

JIEXA

I am getting the following message:
ct annotate [email protected]@/main/mydev/2
cleartool: Error: Operation "annotate" unavailable for manager "z_whole_copy"
        (Operation pathname was: "/opt/rational/clearcase/lib/mgrs/z_whole_copy/annotate")

this is what i found thro net.
annotate is fundamentally text/line oriented, thus it makes no sense to run it for elements which aren't of that type. If your element is a text file,
only with the wrong eltype, you probably want to change its type (ct chtype).

how can i check type of the file?
link
gram77's gravatar image

gram77

For my case, element type is "text_file".
Use "cleartool file ..." for testing element type.
link
JIEXA's gravatar image

JIEXA

yes, all those are test file, what kind of files will annotate work on, and how do i search for such files?
link
gram77's gravatar image

gram77

I suppose you can do "cleartool annotate" for text_file and html types.

I don't understand what are you trying to do, because your last question is going in another direction than the original one. But you can use:

cleartool find . -type f -exec 'cleartool file %CLEARCASE_PN% | egrep -q "text_file|html" && echo "%CLEARCASE_PN%"  '

Or, you can do "cleartool annotate" for a set of files, and just to ignore the errors, and then "find . -name '*.ann' " to find the resulting annotation files.
link
JIEXA's gravatar image

JIEXA

command didnt't work for me?
cleartool find . -type f -exec 'cleartool file %CLEARCASE_PN% | egrep -q "text_file|html" && echo "%CLEARCASE_PN%"  '
link
gram77's gravatar image

gram77

Or, you're on Windows:

cleartool find . -type f -exec 'cleartool file %CLEARCASE_PN% | findstr "text_file" > NUL: && echo "%CLEARCASE_PN%"  '
cleartool find . -type f -exec 'cleartool file %CLEARCASE_PN% | findstr "html" > NUL: && echo "%CLEARCASE_PN%"  '
link
JIEXA's gravatar image

JIEXA

Or simpler:

cleartool find . -type f -element "eltype(text_file)" -print
cleartool find . -type f -element "eltype(html)" -print
link
JIEXA's gravatar image

JIEXA

all files are of type text, so does that mean these files can't be annotate.

what do i need to run annotate on them?
link
gram77's gravatar image

gram77

You can run "cleartool annotate <filename>" on each line you got via "cleartool find".
link
JIEXA's gravatar image

JIEXA

If you want to run annotate on all of them in a batch, you can also do:
  cleartool find . -type f -element "eltype(text_file)" -exec "cmd /c cleartool annotate %CLEARCASE_PN%"
  cleartool find . -type f -element "eltype(html)" -exec "cmd /c cleartool annotate %CLEARCASE_PN%"

And then take a look on *.ann files.
link
JIEXA's gravatar image

JIEXA

Your answer
[hide preview]

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Tags:

Asked: 05/19/2011 03:58

Seen: 13654 times

Last updated: 05/24/2011 11:03