Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

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

clearcase - How can I find all elements on a branch with version LATEST that has no label applied?

As the title said: I would like to find all elements that are on a branch (e.g. DEV_BRANCH) with LATEST version but that has not yet had any label applied to them.

I know how to find elements that does not have a particular label applied (as in:

But I don't know how to find elements that hasn't got any label applied.

Thanks in advance Mikael

See Question&Answers more detail:os

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

1 Reply

0 votes
by (71.8m points)

The simplest way would be to:

  • find all element with a version in the right branch
cleartool find . -type f -ele "version(.../myBranch/LATEST)" -print
  • ask for a lsvtree and grep for an opening parenthesis (meaning there is at least one label)
cleartool find . -type f -ele "version(.../DEV_BRANCH/LATEST)" 
-exec "cleartool lsvtree "%CLEARCASE_PN%"" | findstr "DEV_BRANCH\[0-9]* ("

You need a pattern in your find (or grep on Unix) in order to detect:

  • DEV_BRANCH
  • a ''
  • a version number
  • a space followed by a '(' (meaning there are one or several labels)

That will give you the list of all elements with any label on it.
Given that you can generate the list of any element with versions in the right branch, you then need to diff the two lists in order to extract all elements from the first list (versions in the right branch) but not in the second one (element with a label).

I don't know of a one-liner solution which would list right away the elements with no labels on them in a given branch...


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...