1

So, I have two ClearCase branches A and B.
I added some files/folders under branch A and then merged from A to B so the file/folders are available under branch B.

Now, I removed those files/folders from branch A by using rmname and continued making my changes under branch B.

Now, I again have to work under branch A using same file/folders, so I tried to merge from B to A and it didn't work.
Trying graphical merge, it showed all the files/folders as difference resolution (file deleted).

One of the option is to do undo difference resolution to get back the files. But, there are many. is there another way to go about it?

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
user2636464
  • 685
  • 7
  • 17

2 Answers2

1

Merging B back to A won't restore those files.
Trying to import them with clearfsimport would create evil twins, so that it not a good option either.

One possible approach is to make a branch referencing a label made in branchA with the files still present, and merge that branch to branchA, in order to restore those files.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • yeah but that won't bring in the changes from branch B on those files/folders. it is like undoing your rmname on branch A but I would like to bring in the files/folders with changes made under branch B. – user2636464 Aug 28 '15 at 10:27
  • @user2636464 you still can merge B after that merge. – VonC Aug 28 '15 at 10:28
1

As you noted, there are a number of options for accomplishing this. I'll mention a couple (pay attention to the '.' characters in the examples below):

1) Use 'cleartool ln' to link the elements into the new directory version on branch A. After checking out the directory on branch A in a view, the command for each element would look something like:

cleartool ln .@@/main/_branch_path_to_/B/LATEST/my_rmnamed_file1 .

2) If you can easily identify the version on the A branch that you checked in immediately after running the 'rmname' commands (in the example below, it's version 5), you can do a simple merge delete (after checking out the directory on the A branch in a view):

cleartool merge -delete -to . .@@/main/_branch_path_to_/A/5

hack
  • 146
  • 5