Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
786 views
in Technique[技术] by (71.8m points)

rollback - How do I roll back a file checked in to Clearcase?

I have a file in my Clearcase repository. I checked it out and modified it, and then checked it back in.

I haven't done anything like make a baseline, or rebase, or deliver in my stream/view.

I regret having made the changes to this file--I should have undone the checkout, in retrospect.

How do I roll back the modifications? (Or undo, or revert, or whatever the correct nomenclature is.)

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

What is described by skwllsp can be be done in a dynamic view through the use of extended pathnames

cd m:/myDynamicView/MyVob/path/to/file
cleartool lsvtree myFile
cleartool checkout -c "cancel co" myFile
copy myFile@@/main/xx myFile
cleartool checkin -nc myFile

with xx being the version number you want to restore.


But should you have made multiple checkins, including some you want to cancel, ClearCase allows you to cancel part of the previous checkins through Subtractive Merge
See IBM "to remove contributions of some versions" (and merge man page)

You can remove all changes from a range of versions at once. For example, the following command removes revisions to versions 14 through 16 on the main branch:

  • On the UNIX system or Linux:
cleartool merge -graphical -to opt.c -delete -version /main/14 /main/16
  • On the Windows system:
cleartool merge -graphical -to opt.c -delete -version main14 main16

You can also remove the changes from one version at a time. For example, the following commands remove only the changes in version 14 from the version of opt.c checked out the current view:

  • On the UNIX system or Linux:
cleartool merge -graphical -to opt.c -delete -version /main/14
  • On Windows systems:
cleartool merge -graphical -to opt.c -delete -version main14

Alternatively, in any of the examples above, you can leave out the -version argument if you use the version extended path for the contributor-version-selector.


Finally, the one thing to not do is a rmver.
This command destroys information irretrievably and this is rarely a good thing.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...