gpt4 book ai didi

clearcase - 什么是用于撤消检查是否相同的 Cleartool 命令?

转载 作者:行者123 更新时间:2023-12-05 07:53:39 27 4
gpt4 key购买 nike

我 checkout 一个 powershell 文件并签名,如果它还没有签名,然后 checkin 。

但我的签到失败,说与前任相同。如果它与以前的版本相同,则撤消 checkout 的 cleartool 命令是什么?

最佳答案

您可以简单地尝试:

cleartool unco

也就是“ undo checkout

现在您不能在 checkin 命令本身中执行此操作。

你能做的是 cleartool diff : 如果没有检测到差异,那么你 unco,如果有,你 checkin 。

你有详细的方法in this thread :

You may need to diff against the previous version, but you can use something like diff <file> <file>@@/main/branch/version, and if different (or whatever that diff returns if they are different), then allow the checkin to succeed). Otherwise maybe unco -rm the file.

或者:

In our makefile we have a section that basically follows the following format for each file:

call checkin_if_changed.bat "dir1\sub\file.h"

The contents of the file "checkin_if_changed.bat" are as follows:

cleartool diff -pre -dif %1
echo File: %1 diff result: %ERRORLEVEL%
goto diff%ERRORLEVEL%
:diff1
cleartool ci -c "Build box build." %1
goto end
:diff0
cleartool unco -rm %1
:end

Basically we do a cleartool diff against the prev version of the file.
If the cleartool diff returns a 0 it means the files are identical, so we do an unco -rm.
If cleartool diff finds a difference it returns a 1, meaning the files are different, and we check it in.

或者:

I've used the somewhat messy:

cleartool lsco -cvi -avo -fmt "ci -nc '%n'\nunco -rm '%n'" | cleartool

If the file is identical (and fails the checkin), then it unchecks it out.
If it isn't identical, it checks it in, then the unco command fails (since it's not checked out) with an error (but continues).

You can dump all of the output to a log file if you don't want to see it on the command line. You can probably refine that if you need to.
If you have a post checkin trigger that forces you to enter a comment, then change the -nc to -c 'some comment' instead.

关于clearcase - 什么是用于撤消检查是否相同的 Cleartool 命令?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32392429/

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