问题
For a given file, say I branched off from /main/2 and do my development in that branch newBranch. cleartool diff -pred would compare my loaded version (/main/newBranch/LATEST) to /main/2. Which clearcase command would I pass either the file name or /main/newBranch and would return /main/2?
I'm just trying to find which version -pred selects, but I can't find out how anywhere!
FOLLOW UP:
Say I checked the file in and now I'm in version /main/newBranch/3. How can I still compare it to where it was branched off from (/main/2)?
回答1:
Which ClearCase command would I pass either the file name or /main/newBranch and would return /main/2?
You can try using cleartool lsvtree, which will list all versions of a file.
cleartool lsvtree myFile | grep main | head 1
As noted, cleartool describe is easier.
How can I still compare it to where it was branched off from (
/main/2)?
You can use the /main/newBranch/0, 0 being the placeholder version created for each new branch, here identical to /main/2, using cleartool diff:
cleartool diff -pred yourFile yourFile@@/main/newBranch/0
回答2:
For my purposes, cleartool describe -short -pred <version0-of-child-branch> did the trick. For my example, this would be cleartool describe -short -pred /main/newBranch/0.
来源:https://stackoverflow.com/questions/36483622/clearcase-how-do-i-find-which-version-i-branched-off-from