Searching ClearCase for a checkin with a specific comment

ε祈祈猫儿з 提交于 2019-12-01 04:19:20

Have you looked at this ? Specifically the section below.

How to find elements and versions with specific comments

I want to find all elements/versions with specific comments like “Jane changed this on 11-26”

M:\my_base_view\my_base_vob>cleartool find -all -exec "cleartool lshistory -minor -fmt \"%n\t%c\n\" \"%CLEARCASE_XPN%\"" >c:\output.txt

**This will pipe the output to a file and you would have to grep the file for the specific comments you're looking for.

M:\my_base_view\my_base_vob>cleartool find . -version !"lbtype(LABEL_NAME)" -exec "cleartool describe -long %CLEARCASE_PN%" >c:\output2.txt

Looks a bit of a fiddly process, regrettably.

VonC

Brian Agnew is on the right track, but a word of caution:

  • I am sure the second command line is NOT needed (cleartool find . -version !"lbtype(LABEL_NAME)"...)
  • 'cleartool find -all' is useful if you think that your file may have been moved, but on a big VOB, that process can be extra long
  • without the '-nvis' option, it won't find the file if it has been 'rmnamed' (removed)
  • using 'lshistory -minor' is sheer madness: on a vob with a few months or years of history, it will simply take too much time. For each element found, it would display the ALL history for all versions of that element, without any possibility to refine that set of versions displayed. That solution simply does not scale.
    That, and the -minoroption of the 'lshistory' command does not bring any value to the problem at hand: it would only display the same version several times, just because of internal comments like 'Attached hyperlink "Change@13707xx@\my_pvob"' or 'Attached hyperlink "Merge@xxxx@\my_vob"'

You need to refine your query with:

  • the type of element wanted (if it is a file: -type f)
  • the date "created_since(30-Jan)&&!created_since(28-Feb))" for instance would limit the date range to consider
  • the user

I would use:

M:\my_base_view\my_base_vob>
  cleartool find -all -type f -user myLogin -version "{created_since(30-Jan)&&!created_since(28-Feb)}" -exec "cleartool descr -fmt \"%n\t%c\n\" \"%CLEARCASE_XPN%\"" >c:\output.txt

That would only look for files checked-in by me for a certain date period, which is a way to have a smaller set of versions to examine.

Note that I use 'descr' (the describe command) which is only for the current version (and not for displaying the all history of an element like 'lshistory' does).

If your file has been rmnamed, run again the same command with the '-nvis' option (it would only find elements, along with their branches and versions, that are not visible (do not have a standard path name) in the view.

Warning: if you specify a "before" date with a day "in the future" (for instance: '&&!created_since(28-Apr)}' whereas we are not the 28th of April yet), it will always select 0 versions (!?).
This is not relevant for your issue, but if you enter a "wrong before date" by mistake, that can lead to the false impression that there is no version to find, where there actually are versions to be found.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!