如何查找clearcase分支下修改的文件 [英] How to find the files modified under a clearcase branch

查看:22
本文介绍了如何查找clearcase分支下修改的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我修改并签入了我的分支下的一堆文件.现在我需要获取我修改的文件列表.有没有脚本可以这样做?

解决方案

cleartool 命令 find 应该可以帮助您找到给定分支上至少有一个版本的任何元素(文件).

<块引用>

下面会找到一个分支上的所有文件

cleartool 查找.-type f -branch "brtype(mybranch)" -print

参见查找示例cleartool find 命令的其他示例"以获取更多示例.><小时>

OP sarath 补充说:

<块引用>

它给了我一个带有@ 和其他字符的残缺文件名.是否可以通过正常路径获取?

没错,这样的命令会给你类似的东西(例如):

..checkstyle@@mainMyBranch..classpath@@mainMyBranch_IntMyBranch..classycle@@mainMyBranch_IntMyBranch..fbprefs@@mainMyBranch_IntMyBranch

要仅获取路径,您有两种解决方案:

1/寻找具有正确分支的元素(而不是版本):

cleartool 查找.-type f -ele "brtype(mybranch)" -print

(注意 -ele 替换了 -branch)
那会给:

..checkstyle@@..classpath@@..classycle@@..fbprefs@@..pmd@@

但你仍然有丑陋的"'@@'.

2/将 find 与描述用 fmt_ccase 格式:

cleartool 查找.-type f -ele "brtype(mybranch)" -exec "cleartool descr -fmt "%En
" "%CLEARCASE_PN%""

多行表格以提高可读性:

cleartool 查找.-type f -ele "brtype(mybranch)" -exec "cleartool descr -fmt "%En
" "%CLEARCASE_PN%""

请注意,所有内部"双引号都需要转义.

%En 会给你找到的元素的名称.

..checkstyle..classpath..classycle..fbrefs..pmd..项目..settingsdico.txt

I modified and checked-in a bunch of files under my branch. Now I need to get the list of files I modified. Is there any scripts to do so?

解决方案

The cleartool command find should help you find any element (file) with at least one version on a given branch.

The following will find all the files on a branch

cleartool find . -type f -branch "brtype(mybranch)" -print

See find examples or "Additional examples of the cleartool find command" for more examples.


The OP sarath adds:

it gives me a crippled file name with @ and other characters. Is it possible to get with normal path?

True, such a command would give you something like (as an example):

..checkstyle@@mainMyBranch
..classpath@@mainMyBranch_IntMyBranch
..classycle@@mainMyBranch_IntMyBranch
..fbprefs@@mainMyBranch_IntMyBranch

To get only the path, you have two solutions:

1/ look for elements (and not versions) with the right branch:

cleartool find . -type f -ele "brtype(mybranch)" -print

(note the -ele replacing the -branch)
That would give:

..checkstyle@@
..classpath@@
..classycle@@
..fbprefs@@
..pmd@@

But you still have the "ugly" '@@'.

2/ combine the find with an exec directive which describe the element found with fmt_ccase format:

cleartool find . -type f -ele "brtype(mybranch)" -exec "cleartool descr -fmt "%En
" "%CLEARCASE_PN%""

Multi-line form for readability:

cleartool find . -type f -ele "brtype(mybranch)" 
  -exec "cleartool descr -fmt "%En
" "%CLEARCASE_PN%""

Please note that all "inner" double quotes need to be escaped.

The %En will give you the name of the element found.

..checkstyle
..classpath
..classycle
..fbprefs
..pmd
..project
..settingsdico.txt

这篇关于如何查找clearcase分支下修改的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆