0

I want to find in which ClearCase label a specific string was added in code?

I am using base ClearCase.

πάντα ῥεῖ
  • 1
  • 13
  • 116
  • 190
Michael Oks
  • 93
  • 1
  • 10
  • 1
    Are you using base or UCM ClearCase? Which version? Why c++? Are you trying to program that search in c++? – VonC Jun 11 '17 at 06:26

2 Answers2

1

I recommended before (8 years ago) to limit the scope of your search and use the exec clause of a cleartool find.

Example:

cleartool find -all -type f -user myLogin \
  -version "lbtype(A_LABEL)" \
  -exec ...

If you can do so in a dynamic view, you can then directly grep the content of CLEARCASE_XPN, the variable set by cleartool find for each version found.
It reference an extended pathname that (in a dynamic view) you can directly read and grep for your code)

You can do so for each label you can find in your Vob, from the oldest to the newest.

Z:myvob>ct lstype -kind lbtype -short
Z:myvob>ct find . -version "lbtype(A_LABEL)" -print
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
0

If you are looking for a specific change in a given source file, the cleartool annotate command will give you a good start. If you're familiar with GIT, this is the equivalent of "git blame."

Annotate works only if the element is one of the text file types (text_file, utf?_text_file, etc.) since those store delta information on a per version basis.

One caveat is that this will tell you what version the change came from, but if that version was created by a merge, you may have to backtrack the merge to find the original location of the change. ALMToolbox's "visual annotate" tool does that for you, if I recall correctly.

Brian Cowan
  • 1,048
  • 6
  • 7