2

Is it possible to know what line in a config spec applies to a specific element? Here is what I mean exactly:

If I do ct ls some_file, the output is going to be:

/path/to/some_file@@/main/10    Rule: /main/LATEST -time 12-Jun-2013.18:00UTC+1

This is all fine and dandy, but I would like to know where exactly the rule comes from. Our company uses hierarchical config specs (config specs that include other config specs) so the rule might not be defined in the top level one.

Is there a ClearCase command that can show me in what file (and preferably also the line) the rule was defined?

Tudor Timi
  • 7,453
  • 1
  • 24
  • 53
  • I cringe every time I see a config spec with a date field in it done BY POLICY. That's fine for a quick custom check to see in the very short term, though. I also cringe every time I see a config spec that is longer than about 5 lines without VERY good reason to be. – Jon V Sep 15 '14 at 05:58
  • @JonV The bright idea the enlightened minds had was that because labels can be (potentially) moved, they'd rather implement a release mechanism based on versioned config specs. We're a hardware company and people don't really know how to use version control, IMO, nor do they have any will to learn... – Tudor Timi Sep 15 '14 at 08:39

1 Answers1

1

Not that I know of.

But a config spec rule is applied from top to bottom, with the first one selecting anything being applied.

So in your case, you can go from the top config spec to the most specific one and the first one with a selection rule involving /main/LATEST wins.
See "How a config spec works"

https://publib.boulder.ibm.com/infocenter/cchelp/v7r0m0/topic/com.ibm.rational.clearcase.tutorial.doc/images/config_spec_ux.gif

To automate that process would mean:

  • take all config specs involved
  • build a config spec with the first line of the first config spec
  • check if that select your version with the same selection rule
  • if not, add the second line of the first config spec (and so on)
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • @Tudor I don't. If you do, use the `cleartool setcs` (http://stackoverflow.com/a/23990559/6309) to set a config spec from a file in a *dynamic* view (not a snapshot view): a `cleartool ls` within a dynamic view will take into account the new config spec immediately (as opposed to a snapshot view, that you would have to `cleartool update` first) – VonC Jun 12 '14 at 18:18