2

Suppose I have a VOB foo/. In this VOB lies a directory bar/ which contains labeled and non-labeled files. But bar/ is not the only directory in foo/, but all others don't have labeled files. Is there a way to write a config spec with the following behaviour:

  • load all elements that are checked out
  • for every directory except foo/bar/ load the main/LATEST version
  • for the directory foo/bar/ load only the files which have that specific label, if this label does not exist, do not load the main/LATEST version

The normal config spec would be

element * CHECKEDOUT
element * LABEL
element * /main/LATEST
load /foo

But obviously it would then load also the non-labeled versions in /foo/bar. Thanks in advance.

dudenr33
  • 1,119
  • 1
  • 10
  • 26

1 Answers1

2

You can add paths to your config spec in order to apply specific selection rule to said paths:

element * CHECKEDOUT
element foo/bar/... MYLABEL
element foo/bar/... -none
element * /main/LATEST
load /foo

I would recommend testing that config spec in a dynamic view first, then apply it to the snapshot view.

The three dots notation (foo/bar/...) means: the bar folder and all its subelements.

Note that this won't always display all elements labelled with MYLABEL: if one the parent folders has not the label MYLABEL, no other sub-element will be visible, accessible and selected.
This is especially true here considering the rule element foo/bar/... -none which is there to prevent selecting /main/LATEST for foo/bar (is there is no MYLABEL)

The order of the rules is important here, since the first one which applies is the one used by ClearCase: you can find a similar idea in "ClearCase view that ONLY shows files/directories attached to a label (not latest)"

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Thank you for your answer. I won't get to try it out until Thursday, but I will accept the answer as soon as I have done so. – dudenr33 Mar 02 '15 at 14:24
  • I tried the solution above: I had an existing snapshot with some directories to exclude, but the `-none` did not work. When looking at the `VOB` the folders still exist with all of their content. Note that the folders I want to remove are links to other folders in a different `VOB`. I want to remove them because the snapshot `VIEW` does not know how to handle symbolic link (It duplicates the files - this after we get compilation/debug issues, because checking out in one `VOB` is not reflected in the other `VOB`). – Juv Jul 02 '20 at 15:00
  • @Juv Not sure, I always used that config spec successfully before. What version of ClearCase are you using, on which OS? (both client and server) – VonC Jul 02 '20 at 15:46
  • ClearCase version 9.0.1.9 (both client and server) on Windows 10. I thought it might be connected to the fact that this is an existing snapshot. Or to the fact that this folders are Symbolic links, and I want to show them only in their original VOB. We considered removing the links, but due years of mix ups, there are too many projects to fix references in. – Juv Jul 02 '20 at 15:59
  • @Juv Would https://stackoverflow.com/a/24952026/6309 help? – VonC Jul 02 '20 at 16:02
  • Actually I don't like the answer there, because it tells me that I need to un-reference the original directory, which means I will loose both directories which I want to avoid. BTW the server is Windows Server 2016. – Juv Jul 02 '20 at 16:33