Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
659 views
in Technique[技术] by (71.8m points)

scripting - Find merge arrows pointing to a version in ClearCase

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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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:gammavob1projincludedb.c@@main52 <- M:gammavob1projinvega@@main5

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...