1

My team has a VOB in clearcase. Suppose my project looks something like this :

Project (Directory)
- Module 1 (Sub-directory)
- Module 2 (Sub-directory)

When I write my config-specs, I want to specify that if a new file is created in Module 1 sub-directory, it goes to Branch branch/LATEST, otherwise, if it is created somewhere else, I would like it to be versioned on main/LATEST.

I am able to specify that any newly created file goes to branch B using the spec:

element * /main/LATEST -mkbranch branch

Is there any way to specify the branching based on where that file is created?

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
Manish Sharma
  • 170
  • 2
  • 11

1 Answers1

2

From config_spec, you can use a path pattern like:

element /my_vob/module1/... .../branch/LATEST
element /my_vob/module1/... /main/LATEST -mkbranch branch
element /my_vob/module1/... /main/0 -mkbranch branch

That supposes module1 is a folder within a vob.
See "ClearCase Config Spec: load only files with specific label from certain directory" as another example.

  • The '/...' means folder and its content (as opposed to '*' with means only the content, not the folder itself)
  • The '.../branch' means branch accessed from any other branch (/main/branch, /main/anotherbranch/branch, ...)

Note that if module1 or module2 were UCM components, they could be managed in their own stream and would have their own branch.
You project could then have symbolic link to two different UCM views.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • You probably want to amend the answer to use "..." after /myvob/module1 instead of "*". The former means "this directory and everything underneath it, including subdirectories." The latter means "Everything in this subdirectory NOT including items in subdirectories." – Brian Cowan Aug 04 '16 at 14:48
  • @BrianCowan Thank you. I have amended the answer. I used dots by the past (http://stackoverflow.com/a/28805606/6309) – VonC Aug 04 '16 at 14:55
  • Thanks a lot! That perfectly helps. Could you please elaborate what this path pattern achieves. – Manish Sharma Aug 04 '16 at 15:09
  • 1
    @ManishSharma the path patterns allows to apply a config spec only to the files which match that pattern. – VonC Aug 04 '16 at 15:09