递归查找当前目录下所有视图私有文件的命令
递归查找当前目录中所有视图私有文件的clearcase命令是什么?
What is the clearcase Command to find all view private files in the current directory recursively?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
常用命令基于
cleartool ls
:ct lsprivate
:但仅适用于动态视图,不适用于快照视图ct ls -rec -view_only
:至少,它在快照和动态视图中都有效,但是两者都列出了您签出的文件。
如果您只需要私有文件,即跳过被劫持/Eclipsed/签出和符号链接,则需要将它们过滤掉。
在 Windows 中,这将是:
在 Unix 中:
The usual commands are based on
cleartool ls
:ct lsprivate
: but it is only for dynamic views, not snapshot viewsct ls -rec -view_only
: at least, it works in both snapshot and dynamic viewsHowever both list also your checked-out files.
If you want only the private files, ie skipping the hijacked/eclipsed/checked-out and symlinks, you need to filter those out.
In Windows, that would be:
In Unix:
如果它可以帮助其他人阅读这个问题,这里是 VonC 的 Windows 解决方案,进行了一些小的更改以作为 Windows 脚本运行:
将
@echo
替换为rmdir /S /Q
和del /F
执行实际删除,如此处所述。所以最终的脚本是:如果您在要清理的视图元素下另存为 .bat 文件,则脚本也会通过删除自身来进行清理:-)
In case it helps anyone else reading this question here is VonC's windows solution with a couple of minor changes to run as a windows script:
Replace
@echo
withrmdir /S /Q
anddel /F
to do the actual deletions as described here. So the final script is:If you save as a .bat file under the element of the view you are cleaning from, the script will clean up by deleting itself as well :-)
我通过@MilesHampson 修改了该版本,因为这为我返回了太多结果,并且我想将其作为批处理文件运行。
我的新文件不会位于
debug
或obj
文件夹中,因此,我不需要查看这些文件夹的任何结果...我也只在 C# 上工作。这就是我需要看到的。使用上述内容创建一个bat文件,将其放入根项目文件夹中并运行它。它将显示那些不在源代码管理中的内容。
I amended the version by @MilesHampson since this returned too many results for me and, I want to run this as a batch file.
My new files won't be in the
debug
orobj
folder and as such, I don't need to see any results for those folders... I'm also only working on C#. So that's all I need to see.Create a bat file with the above, drop it into your root project folder and run it. It will display those not in source control.
如果它可以帮助其他人阅读这个问题,这里是 VonC 的 Unix 解决方案,经过一些小的更改可以在 Windows 上的 Cygwin 下运行。
在 Cygwin 中:
Cygwin 行与 VonC 给出的 Unix 类似,但请注意最后一个 grep 上需要双破折号(并且不需要 xargs)。
In case it helps anyone else reading this question, here is VonC's Unix solution with a couple of minor changes to run under Cygwin on Windows.
In Cygwin:
The Cygwin line is similar to the Unix given by VonC, but note the double-dash on the last grep is needed (and the xargs is not needed).
还会过滤出签出的文件
ct lsprivate -co
:列出所有签出的文件ct lsprivate -do
:列出所有派生的对象文件ct lsprivate -other
:列出所有其他私有文件Would also filter out checked-out files
ct lsprivate -co
: list all checked-out filesct lsprivate -do
: list all derived object filesct lsprivate -other
: list all other private files我遵循了上述所有解决方案,这是一个很棒的命令。我还有一些上面未涵盖的要求,因此我用以下附加点对脚本进行了更多修改
从列表中删除了目录,因为我通常对文件感兴趣< /p>
专门针对 java 开发人员,排除了目标文件夹和 jar 文件
因为它们通常不会被签入
Removed .classpath, .project 中检查
和特定于 Eclipse 的 .settings 文件夹(如果它们相同)
级别为项目/模块)
<前><代码>@echo 关闭
设置本地
@回声。
@echo 正在搜索,请稍候,因为这可能需要一段时间...
@回声。
for /F "usebackq delims=" %%i in (`cleartool ls -rec ^| find /V "规则:" ^| find /V "劫持" ^| find /V "黯然失色" ^| find /V "- ->" ^| find /V ".settings" ^| find /V "jar" ^| find /V "keep" ^| find /V "target" ^| find /V ".classpath" ^| 查找 /V ".project" ^| 查找 /V "%~n0" `) do ( 如果不存在 %%i\* @echo "%%i")
@回声。
@echo === === === === === 搜索完成 === === === === === ===
@回声。
@回声。
暂停
I followed all above solutions and it is great command. I had some more requirements that were not covered above so I modified script little more with below additional points
Removed Directory from list as generally I am interested in file
Specially for java developer, excluded target folder and jar files
as they are not generally checked in
Removed .classpath, .project
and .settings folder which is specific to Eclipse (if they are same
level as project/modules)