In ClearCase, abel LB_REL_1. can you please tell me what config spec I should useConfig spec to checkout from a Label?

scott123's picture
scott123 asked on June 20, 2011 - 11:52am | Replies (8).

I am using the below config spec which will checkout all the elements from the Label LB_REL_1:

element * CHECKEDOUT
element * .../br_rel_1/LATEST
element * LB_REL_1 -mkbranch br_rel_1

But the problem is I am Not able to Add a new element to source control, I am getting error which says No such Label or Branch exists. Then I tried using the below config spec:

element * CHECKEDOUT
element * .../br_rel_1/LATEST
element * LB_REL_1 -mkbranch br_rel_1
element * /main/LATEST

But this config spec has checkedout all the elements from the VOB even those without the Label LB_REL_1.

Can you please tell me what config spec I should use so that ONLY those elements with Label LB_REL_1 are checkedout AND also I should be able to create NEW elements and Add them to source control.

It would be great help if you can help me.
Thanks in advance

8 Answers

scott123's picture
scott123 replied on June 20, 2011 - 11:55am.

I also need the Branch br_rel_1 to be created after checkout from the Label.

martina's picture
martina replied on June 20, 2011 - 12:08pm.

this is not CVS, you don't checkout every file.
You only checkout the ones you will most likely modify.

adding a rule with a mkbranch for /main/0 will work for creating new elements and otherwise show you empty files (if there is no br_rel_1 branch), which hopefully won't upset your compiler

element * CHECKEDOUT
element * .../br_rel_1/LATEST
element * LB_REL_1 -mkbranch br_rel_1
element * /main/0 -mkbranch br_rel_1

pdhaggerty's picture

Add to end of ConfigSpecs to add new elements for branch:
element * /main/0 -mkbranch br_rel_1

scott123's picture
scott123 replied on June 21, 2011 - 2:49am.

Thanks Martina and Pdhaggerty for your reply to my post.
I have tried with your config spec:

element * CHECKEDOUT
element * .../br_rel_1/LATEST
element * LB_REL_1 -mkbranch br_rel_1
element * /main/0 -mkbranch br_rel_1

but as I have selected the Full VOB as Load rules, it has checked out other folders also which DO NOT have the Label LB_REL_1. As such the checkedout folders(not having the Label LB_REL_1) do not contain any files, they are empty. So do I need to Load only those elements or Folders in the VOB which needs to be modified? Because in future, if some other elements needs to be worked upon, I need to Load the Rules again by selecting the particular element or folder. Please guide me how I can load only the Labelled elements and as well as create new elements.

martina's picture
martina replied on June 21, 2011 - 10:19am.

Again, this is not CVS or subversion or ....

There is a difference between loading and checking out. Loading means you see the element (file or directory), you can read it, your compiler can read it. Checkout means that you intend to modify it.

You need to load everything that you need for a build. You need to checkout everything that you want to modify and later check-in.

In a dynamic view you always see everything that the cs shows, there is no load step to begin with because its "instant on". In a snapshot view you have to load things and that takes time and space, so you can choose to load only the pieces you really need.

Unless your compiler acts up with the empty elements, just ignore them. Its like when you look at a shared drive. You look only at the things that you are interested in and ignore the things you are not interested in.

If you are a build or release person, you will want to comment out the /main/0 line when you are labeling things, but as a developer, just ignore them.

Sten Rosendahl's picture

I always add another rule to cover for non-labeled elements, like this:

element * CHECKEDOUT
element * .../br_rel_1/LATEST
element * LB_REL_1 -mkbranch br_rel_1
element * /main/LATEST -time <timestamp> -mkbranch br_rel_1
element * /main/0 -mkbranch br_rel_1

where <timestamp> is the the timepoint when applying LB_REL_1 (or the time of the latest update in case of snapshot views)

Also, I never load complete VOBs, partly because you never need all files and partly due to loading lost+found will cause trouble.

I think there is some terminology confusion here, checkout in ClearCase (cvs admin -l in CVS) is not at all the same thing as checkout in CVS which is more like load rules in ClearCase snapshot views.

Regards,
Sten

scott123's picture
scott123 replied on June 22, 2011 - 7:26am.

Thank you so much Martina and Sten for your reply, I will load only those elements which are needed, this should solve my problem.

Marc Girod's picture

sten wrote: "I always add another rule to cover for non-labeled elements"

I never use -time rules. They give a false sense of security (at least in MultiSite context).

The whole purpose of the alternative label type--/main/0 is precisely to avoid the surprise of non-labelled files creeping in by surprise.

The first point is simple: every syncreplica import is susceptible to change your past, i.e. to bring in versions stamped earlier than your reference, whatever it is.

The only way around is to use only local labels in config specs, and to lock (and possibly unlock/re-lock) them. This way, you get a reliable timestamp: no label of a type was applied after it was last locked. The problem this deals with is purely one of special relativity. Not likely to go away soon.

Marc

CMCrossroads is a TechWell community.

Through conferences, training, consulting, and online resources, TechWell helps you develop and deliver great software every day.