如何查找clearcase分支下修改的文件

发布于 2024-11-03 20:44:37 字数 54 浏览 0 评论 0原文

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

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

倥絔 2024-11-10 20:44:38

尝试这个命令

cleartool find -avo -nxname -element '{brtype(branch_name)}' -print

try this command

cleartool find -avo -nxname -element '{brtype(branch_name)}' -print
海未深 2024-11-10 20:44:38

使用以下脚本

   #!/bin/sh

   display()
   {
       echo "usage: $0 branchname -v vobs"
       echo "  branchname: optional, if absent uses the current view-name"
       echo "  -v vobs: optional, if absent uses default vob list"
   }

  if [ $# -gt 1 ]; then
      if [ $1 == -v ]; then
          branch=`basename $CLEARCASE_ROOT`
          VOB_LIST=${@:2:($# - 1)}

      elif [ $2 == -v ]; then
          branch=$1
          VOB_LIST=${@:3:($# - 2)}

      else
          display
         exit 1
      fi

  else
      VOB_LIST="/vobs/abc /vobs/def /vobs/ghi /vobs/jkl /vobs/mno"

      if [ $# -eq 1 ]; then
         if [ $1 == -h ]; then
              display
              exit 0
          else
              branch=$1
          fi
      else
         branch=`basename $CLEARCASE_ROOT`
      fi
  fi

  echo "Searching for files of branch <$branch> in following vobs:"
  echo "$VOB_LIST"
  echo "================================================================"

  cleartool find $VOB_LIST -all -version "version(.../$branch/LATEST)" -print

将其保存在名为 ctlsbr 的文件中,并从您想要查找已修改文件列表的 vob 中使用它。

谢谢,
阿米特

Use the following script

   #!/bin/sh

   display()
   {
       echo "usage: $0 branchname -v vobs"
       echo "  branchname: optional, if absent uses the current view-name"
       echo "  -v vobs: optional, if absent uses default vob list"
   }

  if [ $# -gt 1 ]; then
      if [ $1 == -v ]; then
          branch=`basename $CLEARCASE_ROOT`
          VOB_LIST=${@:2:($# - 1)}

      elif [ $2 == -v ]; then
          branch=$1
          VOB_LIST=${@:3:($# - 2)}

      else
          display
         exit 1
      fi

  else
      VOB_LIST="/vobs/abc /vobs/def /vobs/ghi /vobs/jkl /vobs/mno"

      if [ $# -eq 1 ]; then
         if [ $1 == -h ]; then
              display
              exit 0
          else
              branch=$1
          fi
      else
         branch=`basename $CLEARCASE_ROOT`
      fi
  fi

  echo "Searching for files of branch <$branch> in following vobs:"
  echo "$VOB_LIST"
  echo "================================================================"

  cleartool find $VOB_LIST -all -version "version(.../$branch/LATEST)" -print

Save this in a file named ctlsbr and use this from the vob you want to find out the list of modified files.

Thanks,
Amit

泪之魂 2024-11-10 20:44:37

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

下面将查找分支上的所有文件

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

请参阅查找示例或“<一个href="https://www-304.ibm.com/support/docview.wss?uid=swg21124425" rel="noreferrer">cleartool find 命令的其他示例”了解更多示例。


OP sarath 添加:

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

确实,这样的命令会给你类似的东西(作为示例):

.\.checkstyle@@\main\MyBranch
.\.classpath@@\main\MyBranch_Int\MyBranch
.\.classycle@@\main\MyBranch_Int\MyBranch
.\.fbprefs@@\main\MyBranch_Int\MyBranch

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

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

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

注意 -ele 替换 -branch
这会给出:

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

但你仍然有“丑陋的”'@@'。

2/ 将 find 与 exec 指令结合起来,该指令描述通过 fmt_ccase 格式

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

多行形式以提高可读性:

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

请注意,所有“内部”双引号需要转义。

%En 将为您提供找到的元素的名称。

.\.checkstyle
.\.classpath
.\.classycle
.\.fbprefs
.\.pmd
.\.project
.\.settings\dico.txt

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@@\main\MyBranch
.\.classpath@@\main\MyBranch_Int\MyBranch
.\.classycle@@\main\MyBranch_Int\MyBranch
.\.fbprefs@@\main\MyBranch_Int\MyBranch

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\n\" \"%CLEARCASE_PN%\""

Multi-line form for readability:

cleartool find . -type f -ele "brtype(mybranch)" \
  -exec "cleartool descr -fmt \"%En\n\" \"%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
.\.settings\dico.txt
饮湿 2024-11-10 20:44:37

find 命令是最好的来源。为了解决 OP 担心用 @@ 取回“残缺”名称以及之后的所有分支和版本信息,可以添加“-nxn”选项以不提供此信息。这比结合 exec 指令进行元素搜索来格式化输出要容易得多。

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

The find command is the best source. To address the OPs concerns about getting back a "crippled" name with @@ and all of the branch and version information afterwards, the "-nxn" option can be added to not provide this info. This is much easier that doing the element search combined with exec directive to format the output.

cleartool find . -type f -branch "brtype(mybranch)" -nxn -print
若有似无的小暗淡 2024-11-10 20:44:37

上述命令将给出特定 branch(myBranch) 中修改的所有文件。
但是,如果您想查找特定用户在特定日期修改的文件,您将需要以下命令:(

cleartool find . -version "{created_since(28-APRIL-2011.23:00:00) \
                           && (!created_since(29-APRIl-2011.23:00:00)) \
                           && brtype(BR_test) \
                           && created_by(p723029)}" \
                 -exec "cleartool describe -fmt \nName\t\t:\040%En\nResponsible\t:\040%u\nDate\t\t:\040%d\nComment\t\t:\040%c\n %CLEARCASE_XPN%" \
                 -print >> D:\test.xls

在一大行中用于复制/粘贴目的:)

cleartool find . -version "{created_since(28-APRIL-2011.23:00:00) && (!created_since(29-APRIl-2011.23:00:00))  && brtype(BR_test)  && created_by(p723029)}" -exec "cleartool describe -fmt \nName\t\t:\040%En\nResponsible\t:\040%u\nDate\t\t:\040%d\nComment\t\t:\040%c\n %CLEARCASE_XPN%" -print >> D:\test.xls

The above command will give all the files modified in particular branch(myBranch).
But if you want to find the files modified by particular user in particular date, you would need the following command:

cleartool find . -version "{created_since(28-APRIL-2011.23:00:00) \
                           && (!created_since(29-APRIl-2011.23:00:00)) \
                           && brtype(BR_test) \
                           && created_by(p723029)}" \
                 -exec "cleartool describe -fmt \nName\t\t:\040%En\nResponsible\t:\040%u\nDate\t\t:\040%d\nComment\t\t:\040%c\n %CLEARCASE_XPN%" \
                 -print >> D:\test.xls

(in one giant line for copy/paste purpose:)

cleartool find . -version "{created_since(28-APRIL-2011.23:00:00) && (!created_since(29-APRIl-2011.23:00:00))  && brtype(BR_test)  && created_by(p723029)}" -exec "cleartool describe -fmt \nName\t\t:\040%En\nResponsible\t:\040%u\nDate\t\t:\040%d\nComment\t\t:\040%c\n %CLEARCASE_XPN%" -print >> D:\test.xls
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文