3

I have a requirement posted by the development team to reverse all changes in a given UCM activity. Constraint being we do not have delete rights. Meaning I know I can do a lsactivity to list all elements in an activity with their respective versions and then in the easy world would be able to delete those versions.

But the SCM policy does not permit us to delete/rmver anything. So I am left with back merging 1 version back. Meaning let us say I have version 5 of a.java checked into an activity. One way I think to achieve this, is find version 4 (using -predecessor) and blind copy this ver 4 as ver 6. Assume that each file has only 1 version in an activity this time. If a file had more than 1 versions checked in through an activity, this would be more complex, so lets ignore that for now.

Any other ideas or whether my approach would/would not work ?

Sneftel
  • 40,271
  • 12
  • 71
  • 104
Pulak Agrawal
  • 2,481
  • 4
  • 25
  • 49

1 Answers1

5

One more robust way would be to:

  • list all files in an activity
  • for each file, find the oldest version
  • make a negative merge, or subtractive merge.

A subtractive merge can be performed to exclude or bypass bad versions on a branch without actually removing the bad versions.
Cleartool merge using the -delete option will allow a user to merge from the last known good version to a new version on the same branch which excludes the work done in the versions identified as bad versions.

That would be compliant with your SCM policies in place.

That is in essence what does the cset.pl script mentioned by Tamir, as I explain in "Clearcase: how to rollback all changes on specific branch?"

ccperl cset.pl -undo myActivity
Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • 1
    Note to self: doc on subtractive merge: http://publib.boulder.ibm.com/infocenter/cchelp/v7r0m0/index.jsp?topic=/com.ibm.rational.clearcase.cc_proj.doc/c_bcc_mrgrmvsome.htm and http://techpubs.sgi.com/library/tpl/cgi-bin/getdoc.cgi?coll=0530&db=bks&srch=&fname=/SGI_EndUser/ClrC_UG/sgi_html/ch06.html#id5460730 – VonC Nov 08 '11 at 11:48
  • thanks .. I searched for .pl in that zip which Tamir led me to , and could see the main business logic was **merge -delete**. – Pulak Agrawal Nov 09 '11 at 03:29