gpt4 book ai didi

clearcase - 删除版本为 "0"的 Clearcase 元素分支的命令

转载 作者:行者123 更新时间:2023-12-04 17:36:03 25 4
gpt4 key购买 nike

Clearcase 中删除未修改元素的分支的命令是什么(该分支中的元素版本为“0”)?

最佳答案

您可以简单地删除该元素的版本 0(即 I detail here )。

这将删除关联的分支。

cleartool rmver file@@/main/aBranch/0

您需要“ cleartool find ”所有版本为 0(没有版本 1)的元素,以及 rmver那些版本 0。
对于给定的分支,这将返回要删除的所有版本:
cleartool find -type f -version "version(.../blah/LATEST)&&version(.../blah/0)" -print

您可以将其与 exec 指令结合使用:
# on Windows:
cleartool find ... -exec "cleartool rmver --force \"%CLEARCASE_XPN%\"
# on Unix:
cleartool find ... -exec 'cleartool rmver --force "$CLEARCASE_XPN\"'

小心 rmver , this is a destructive operation ,因此请在执行完整 find -exec rmver 之前仔细测试。命令!

另一种方法在 George F. Frazier 的“ Purging Zero-Version-Only Elements in ClearCase”文章中提到:

you need to purge your view of those troublesome entities.
Run the following command to find all zero-version elements:


cleartool find -avobs -branch'{
brtype(mybranch)&&!
(version(.../mybranch/1))}'
-print > c:\files.txt

This will find all elements with no version 1 on mybranch (if you read closely you'll notice it doesn't do the right thing if you have removed the 1 version of an element that already has versions greater than or equal to 2 — this is a rare situation though).
Once finished, it's simply a matter of using rmbranch to nuke the elements (make sure you know what you're doing here!).
There are many ways to do that; since I run the MKS toolkit, I execute the following from a command window:


cleartool rmbranch -f 'cat c:\files.txt' 

Tamir suggests触发 automatically remove version 0 ,如 IBM Rational ClearCase: The ten best triggers 中所列,在 部分下Empty Branch .
cleartool mktrtype -c "Automatically remove empty branch" -element -all -postop uncheckout -execwin "ccperl \\mw-ddiebolt\triggers\test_empty_branch.bat" REMOVE_EMPTY_BRANCH

这对于将来撤消 check out 留下版本 0 的情况很有用。

关于clearcase - 删除版本为 "0"的 Clearcase 元素分支的命令,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18183643/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com