2

I have made a bunch of wrong checkins into our source control. before starting the modifications I labeled all the elements versions with a label.

how can I tell clearcase to do a merge search and come up with all the files that are newer than the labeled files so that I can roll back the changes ?

when I do a plain merge nothing comes up

Joel
  • 21
  • 3

1 Answers1

1

One solution is simply to setup a new config spec with your label as a starting point, and a mkbranch rule (to create a new branch instead of working on the current one).

That way, you would see and modify only the files with the labelled used before the wrong checkins.
The same idea can be applied with UCM (using a sub-stream from a baseline done just before the wrong checkins)

That being said, for a relatively small number of files to revert, a manual solution based on a find query is possible (windows syntax):

cleartool find -all -element "{lbtype_sub(REL1)" -exec "cleartool find \"%CLEARCASE_PN%\" -version "{created_since(label-date) && brtype(label_branch) }" -print

The idea is to combine a first query to find all elements (files or directories) which have that labels amongst their versions, and then to use that element (referenced through \"%CLEARCASE_PN%\") to find if there is any version created since the date of the label and in the right branch (the one where you did the wrong commits).

This, combined with a negative or subtractive merge, could automate the process.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Thanks, I actually did find the post about the subtractive merge but for the live in me I cant figure out how to make it work when the source is a label and the target is the LATEST all the examples I found so far, are for a single file – Joel May 03 '11 at 15:31
  • @Joel: you can get some ideas with the `cset.pl` script (http://www.ibm.com/developerworks/rational/library/05/0927_bellagio/) which does a similar operation for versions in an UCM activity – VonC May 03 '11 at 15:38