Copying an element from Clearcase with a particula

2019-02-18 13:41发布

问题:

How to copy an element or file from Clearcase with a particular label, without applying that label in config specs.

I don't want to change the config spec of my view, but I need to access an older version of one of my selected files, and I would like to do so directly from my existing view (again, without changing anything).
I know the version I want to restore (from instance version 2, even though I am selecting currently version 3 in my view).

What cleartool command would you use in order to access said old version?

回答1:

You can use the extended pathname, but only using a dynamic view (any existing dynamic view, not particular config spec required).
The article "To open a version not currently in your view from a command prompt using a version-extended path" mentions that you can use a snapshot view too, but you would need for:

  • the element to be already loaded (obviously not at the version you want)
  • the old version to be copied into the view (as a private file): cleartool get -to prog.old.c prog.c@@/main/r1_fix/1

Note that the contextual menu of a version tree includes a "Send To" entry which would effectively do the cleartool get (i.e. the copy) for you.


But in a dynamic view, you don't need to copy anything, you can directly reference any old version:

cp foo.c@@/RLS4.3
cp include.h@@/main/bugfix/REL2 

See also version selector:

If a version label was defined to be one-per-element, an additional link/file system object appears at the top level of an element's directory tree.
For example, if BL3 is a one-per-element label, these version-extended pathnames are both unambiguous references to the same version:

hello.c@@/BL3
hello.c@@/main/bugfix/patch2/BL3

In effect, this feature allows you to reference a version without knowing its exact location in the version tree.

In a dynamic view, when you see hello.c in your view (and that can be any selected version, not the one you want with the label), you actually can do:

cd hello.c@@
dir

That will list all the unique labels for you to choose from.



标签: clearcase