Clearcase: moving a sub branch to a main branch

2019-02-20 11:12发布

问题:

In clearcase I started work on a branch called main/release4/release5. After I had began my work, release4 was merged into main. My coworkers started work on main/release5. Is there anyway I can move my main/release4/release5 work to main/release5?

So far, I've tried to merge from main/release4/release5 to main/release5 but that didn't work. The files stayed on main/release4/release5.

Visual example of what it looks like in version tree:

main
|   \
|     release 4
|     /      \ 
main        release 5
    \              \
    release 5      *move files from here
         \ 
         *to here

Here is the original config spec I was working with.

element * CHECKEDOUT
element - directory * /main/LATEST
element * /main/release4/release5/LATEST
element * /main/release4/LATEST -mkbranch release5
element * /main/LATEST -mkbranch release4

Here is the config spec my coworkers started with after merging release 4 with mainline

element * CHECKEDOUT
element - directory * /main/LATEST
element * main/release5/LATEST
element * main/LATEST -mkbranch release5

回答1:

The idea of those selection rules ending with branchname/LATEST -mkbranch newBranch is to allow an element (file or directory) to start a new branch from whatever version happens to be the LATEST, unless there are already versions on said newbranch.

So it is a file-by-file mechanism.

To ensure all files to start from the release4 merged into main, put a label on all elemenents of main/LATEST right after that merge (preferably using the snapshot view used for said merge), then use a config spec like:

element * CHECKEDOUT
element * .../release5/LATEST
element * REL4 -mkbranch release5
element * main/LATEST -mkbranch release5

Starting a branch from a fixed label is safer than starting from /main/LATEST (which can see a new version at any time)


The OP Gregory Peck comments:

using .../release5/LATEST fixed it!

The reason the "three dots" syntax worked (as illustrated in "clearcase latest version of a file on a particular branch") is that some versions had their branches starting from the release4 branch, other from main.

With .../release5/LATEST, you select the LATEST of release5, no matter which branch release5 is starting from.



标签: clearcase