Search code examples
command-linefindclearcase

Label ClearCase Content As Seen On A Given Date (without changing the config specs)


I need to label the contents of a view as seen at specific dates, and the only way I know of doing it is by using the -time version selector in the config specs. I set the time to the date I want, and then I apply the label on the view. Simple.

However, I was hoping if there is a way to do it pro-grammatically without changing the config specs. I was hoping that I could use the cleartool find in combination with -exec and mklabel. However, if I do this:

cleartool find . -cview -version "! created_since(some-date)" 

It only pulls what was created before that date on the view, not necessarily what should be seen in the view if we were using the -time selector.

And if I use cleartool find with a -branch selector

cleartool find . -cview -version "! created_since(some-branch)" 

it only selects that which was created before that date, on that branch only. It will not show what is also seen in the view on other branches via the config specs rules.

So, am I using cleartool find wrong? Or is it just impossible?

Is there a way, from the command line, to direct cleartool find to find exactly and precisely the elements that

  1. would be seen by the active config rules
  2. in a given directory
  3. regardless of the branch or branches involved,
  4. AS IF there was a -time directive in them?

Thanks.


Solution

  • To my knowledge, the query language isn't rich enough to include what the config spec time rule does.
    A time-based selection rule is the best option.

    What I generally do, in order to use the -time programmatically (since the find wouldn't work) is to:

    • use a dedicated dynamic view (quicker to update than a snapshot view)
    • write in a file the config spec I need
    • cleartool setcs -tag myView myFile # update the config spec of the dynamic view
      (See setcs man page)
    • use the result of the updated content of the dynamic view.