1

I need to apply a label to a particular set of elements in a VOB that are selected by a line in my configspec. I have other lines as well, in my configspec.

For example, let's say here's my configspec.

element * .../bugfixesApril/LATEST
element * WORK122014_v2

How do I apply a label on the set of elements that get selected by the bugfixesApril/LATEST rule?

There are cases where the parent folder is not selected by the same rule, and the elements on which the label is to be applied do not lie in the same location. They are spread throughout the VOB

I have a csv file containing the list of files with complete path (including version number) where the label is to be applied

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
Gavin
  • 91
  • 1
  • 9

1 Answers1

1

The easiest solution is to have another view (preferably dynamic one) with only the right selection rules in order to select only the version you want.

You would then use that view for your cleartool mklabel command.

To be sure to label only the files, and not the parent folder, you can combine mklabel to a cleartool find directive similar to "How can I find all elements on a branch with version LATEST that has no label applied?".

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • But if the parent folder of a given element does not get selected by the rule, wouldn't that make the element invisible as well? – Gavin Apr 27 '15 at 10:00
  • @BarnabasGavinCangan Yes it will: hence the dynamic view for you to add the relevant rules for making all the right elements visible. – VonC Apr 27 '15 at 10:28
  • But if I add more rules to make other elements visible, how do I apply the label only to the originally selected set of elements *(those that were selected by the first rule)* ? Yes, I can still use the mklabel command one file at a time, but I was looking for a solution that would let me apply a label to some 100 elements at versions specified by a .csv file – Gavin Apr 27 '15 at 14:43
  • @BarnabasGavinCangan the rule you would add are only for the parent folders to be visible (selected). The elements within those parent folders would be only the one you want to label, because of the other rule like `bugfixesApril/LATEST`. – VonC Apr 27 '15 at 14:45
  • Sorry that I didn't explain it clearly enough in the question. My problem is that I have around 100 elements checked out in a VOB which has more than 5000 elements. And all these elements are spread out throughout the VOB. Also if I use configspec rules to make all corresponding parent folders visible, the label would also be applied to the parent folders. But since that folder wasn't really checked out by me, I'm not supposed to apply my label on them – Gavin Apr 27 '15 at 14:50
  • @BarnabasGavinCangan Sure, the label *should* be applied on those parent folders. Or you would end up with a label which would be unable to select those 100 elements, since their parent folders would not be selected by that same label. – VonC Apr 27 '15 at 14:52
  • This label I'm about to apply is not a standalone label, and will always be used with a proper integration label below. Like this: element * WORK122014_v2 element * RELEASE_MAJOR_3_4 So, I don't have to apply my label on parent folders. – Gavin Apr 27 '15 at 14:57
  • @BarnabasGavinCangan then you can apply the label through a `cleartool find . -type f -exec 'mklabel newlabel "$CLEARCASE_XPN"'` (as in http://stackoverflow.com/a/4508418/6309). If you can figure out a `cleartool find` command which selects only the files (`-type f`) which you want to label, you are good to go. – VonC Apr 27 '15 at 15:01
  • http://stackoverflow.com/questions/5193832/how-can-i-find-all-elements-on-a-branch-with-version-latest-that-has-no-label-ap?rq=1 – Gavin Apr 27 '15 at 15:06
  • @BarnabasGavinCangan Great! I have included that reference in the answer for more visibility. – VonC Apr 27 '15 at 15:07