Find merge arrows pointing to a version in ClearCase

好久不见. 提交于 2019-12-01 06:46:11

问题


I want to find all the merge arrows pointing to a certain version in a script. When I describe the version of the element with the following command:

ct describe filename@@/main/some_branch/3

I get in the result the following:

Hyperlinks:
  Merge <- filename@@/main/other_branch/2

I want ct describe to output only the relevant information to be used in my script, ie. the versions where the merge arrows come from. In my case, the output should look simply like this:

filename@@/main/other_branch/2

I didn't find any relevant parameters in the -fmt from the man page. Is there any way of doing it?


回答1:


The only option in the fmt_ccase man page would be

%[hlink:filter]p

Displays the hyperlink source and target, with an arrow pointing from the source to the target. The optional H argument lists only the hyperlink names.
You can optionally specify a filter string, preceded by a colon. This filter if present, restricts the output to names that match the filter string. Case is considered when matching the string.

If this doesn't work, you have to resort to grep/awk commands in order to extract those version from the cleartool describe output.

The cleartool descr -ahlink restricts a bit the output.

–ahlink

The listing includes the path names of the objects hyperlinked to pname, annotated with → (listed object is the to- object) or ← (listed object is the from-object).

For example:

-> M:\gamma\vob1\proj\include\db.c@@\main\52 <- M:\gamma\vob1\proj\bin\vega@@\main\5

Beside the full script option, you can have a look at external third-party tools like R&D Reporter, which can vizualize and export those same hyperlinks.
However:

  • this is a commercial tool
  • depending on the export output and what you want, you might end up parsing just another output to extract what you need.

For more on that tool, contact Tamir Gefen.



来源:https://stackoverflow.com/questions/14334919/find-merge-arrows-pointing-to-a-version-in-clearcase

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!