ClearCase仅删除查看私有文件

问题描述:

在CC动态视图中是否只删除视图私有文件。在我看来,有一堆黯然失色的文件和私人文件。我只需要删除查看私人文件,并保留已签出和已删除的文件。

Is there any was to delete only view private files in CC dynamic view. There are a bunch of eclipsed files and view private files in my view. I need to delete only view private files and retain checked-out and eclipsed files.

我尝试了以下操作-

cleartool ls -r | grep -v eclipsed | grep -v checkedout | xargs rm -v

但是看起来,蚀文件被两次用 cleartool ls列出。因此它也删除了蚀过的文件:(

But looks like eclipsed files are listed twice with cleartool ls. So it deletes eclipsed files too :(

cleartool ls -r在动态视图中为蚀过的文件生成两个输出

cleartool ls -r produces two outputs for an eclipsed file in dynamic view.

src.mk
src.mk@@ [eclipsed]

因此使用 cleartool删除ls -rec | grep -v Rule: | grep -v eclipsed | grep- v-> | xargs rm -v 也会删除蚀过的文件。

So deleting with cleartool ls -rec | grep -v "Rule:" | grep -v "eclipsed" | grep -v "-->" | xargs rm -v deletes eclipsed files too.

您是的,这两个部分都不起作用:

You are right, none of those two soution would work:

 cleartool ls -rec | grep -v "Rule:" | grep -v "eclipsed" | grep -v "-->"  | xargs rm -v

cleartool lsprivate | | grep -v eclipsed | xargs rm -v

    cleartool lsprivate | grep -v "eclipsed" | xargs rm -v

来源:我在 命令以递归方式查找当前目录中的所有查看私有文件

An lsprivate 像其他私有文件一样单独列出被遮盖的文件:

An lsprivate alone lists eclipsed file like any other private file:

M:\yourDynView\yourVob\aDir\>ct lsprivate

M:\yourDynView\yourVob\aDir\aFile.vsd
M:\yourDynView\yourVob\aDir\aPrivateFile

但是, lsprivate -l 列出蚀过的文件两次:

But, an lsprivate -l list eclipsed file twice:

M:\yourDynView\YourVob>ct lsprivate -long

view private object    M:\yourDynView\yourVob\aDir\aFile.vsd
file element           M:\yourDynView\yourVob\aDir\aFile.vsd@@ [eclipsed]
view private object    M:\yourDynView\yourVob\aDir\aPrivateFile

So您需要三遍


  • 一个来生成 cleartool lsprivate -l

  • 一个删除行上方的行,其中包含黯淡的

  • 一个可以读取该文件并删除该文件中列出的其余私人文件

  • one to generate that cleartool lsprivate -l
  • one to remove any line above a line which contains eclipsed
  • one to read that file and delete the remaining private files listed in that file

第二步可以是(在此线程

gawk "{if ((NR!=1)&&($0!~/eclipsed/)) {if ($lastlin!~/eclipsed/) {print astlin};lastlin=$0} } END{print lastlin} " s

带有' s '的文件包含 cleartool lsprivate -l 的结果。

With 's' the file containing the result of a cleartool lsprivate -l.