Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

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

clearcase - cleartool question

Lets say I have a directory at estfolder, and the latest is currently at /main/10. I know that the operation resulting in testfolder@@/main/6 is to remove a file named test.txt.

What's a sequence of cleartool operations that can be done in a script that will take "testfolder@@/main/6" and "test.txt" as input, and will cat out the contents of test.txt as of that time?

One way I can think of is to get the time of /main/6 operation, create a view with config spec -time set to that time, and then cat the test.txt at the directory. But I'm wondering if I can do this in a easier way that doesn't involve manipulating config specs, perhaps through "cleartool find" and extended path names

See Question&Answers more detail:os

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

1 Reply

0 votes
by (71.8m points)

If you are using a dynamic view, you should be explore directly the extended pathnames of testfolder in order to access the content of test.txt.

cd m:myviewmyVobpathoestfolder

# In version 5 of testfolder, test.txt was still there
cd @@/main/5 

# Note: test.txt is a directory! only LATEST is a file
type test.txt@/main/LATEST 

The OP adds:

how about if test.txt was moved from testFolder to testFolder2, and then a new version of test.txt is checked in? In this when I go into testfolder@@/main/5, test.txt@@/main/LATEST is incorrect...

Technically, this is a case of evil twins: 2 objects of the same names exists (one in testfolder@@/main/5, one in testfolder@@/main/10) with different history.

You need, to get back the former test.txt (a like rollbacking a file), remove your current test.txt and get back the old one currently moved to Folder2. (cleartool move)

 cd testFolder2
 cleartool checkout -c "move test.txt back to testFolder"
 cd ../testFolder
 cleartool checkout -c "get back test.txt from testFolder2"  
 cleartool rmname test.txt
 cleartool move ../testFolder2/test.txt
 cleartool ci -nc .
 cleartool ci -nc ../testFolder2

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...