Clear Case / CCRC:命令行用法

时间:2014-07-04 10:49:26

标签: clearcase cleartool clearcase-remote-client

我是Clearcase / CCRC的新用户: 我想学习在Windows平台上使用cleartool命令进行CCRC。

我使用CCRC创建了快照视图。 我想使用cleartool命令在文件(在所有分支中)中首次出现字符串。

例如: 如果在版本10的文件Y中引入了函数名称XXXX,那么我想要从基本版本搜索函数XXXX(在文件Y中)的命令,直到引入该函数的版本,并且应该将我输出为版本10。 / p>

请帮我这样做。

1 个答案:

答案 0 :(得分:1)

加载快照视图后,您不需要cleartool命令。

您可以使用simple grep command在文件中进行搜索。

cleartool find命令对于搜索文件版本的消息 comment 中的字符串非常有用,而不是文件内容本身。见those examples

UNIX/Linux:
cleartool find -all -ver "! lbtype(<non-existing label>)" -exec 'cleartool
desc -fmt "Version: %n\tComment: %c\n\n" $CLEARCASE_XPN' | grep <the string
you are looking for>

Windows:
cleartool find -all -ver "! lbtype(<non-existing label>)" -exec "cleartool
desc -fmt \"Version: %n\tComment: %c\n\n\" %CLEARCASE_XPN%" | findstr "<the
string you are looking for>"

对于给定文件,您可以列出fmt_ccase的所有版本:

cleartool find -name "yourfile" -exec "cleartool desc -fmt \"%Ln\" \"%CLEARCASE_XPN%\" && cleartool diff -pred \"%CLEARCASE_XPN%\"|grep XXXX"

(注意:在Windows上,您可以grep使用GoW: Gnu on Windows

我们的想法是列出给定文件的所有版本,并列出每个版本:

  • 打印版本(cleartool desc -fmt "%Ln"
  • 使用先前版本的diff和XXXX
  • 的grep