**On a machine I'm working on, there's this view we shall call magic_view - which exhibits the following strange behavior:
$ ct lsview magic_view
magic_view /view_store/our_team_vws/magic_view.vws
$ ct catcs -tag magic_view
ct: Error: View tag "magic_view": ClearCase object not found
Now, magic_view was not created by me, so I'm guessing something strange happened to it. But - what? What could cause a view to be visible for lsview but unknown for catcs?
That means the view has been registered (cleartool register -view)
But its tag has not been declared (cleartool mktag -view)
cleartool register -view -replace -host newhost -hpath hpath/xxx.vws /hpath/xxx.vws
ct mktag -view -replace -tag tag -host newhost -gpath gpath gpath
The tag part of this picture is missing in your case:
You can see more cleartool mktag -view examples here.
Its tag might be missing from the client region:
Example: to create a windows tag from a UNIX server, for a ClearCase View with its view storage on a NAS device:
cleartool mktag -view -tag samecs_view -region samecs_win -host view_server_host.samecs.com \
-gpath "\\\\samecs\\ccviewstore \\gbush_view.vws" \
-hpath "\\\\samecs\\ccviewstore \\gbush_view.vws" \
/net/samecs/ccviewstore/gbush_view.vws
As Brian Cowan adds in the comments, using the rgy_check command can help.
That will tell you about cc registry issues.
At one time, there were issues getting the configspec of snapshot views if you weren't actually IN the view, but that currently works.
Related
I have a new branch in which I would like to remove some files. I was able to remove some files with this commands:
cleartool co -nc .
cleartool rmname <filename>
cleartool ci -nc .
But for some other files I get this error:
$ ct rmname file
cleartool: Error: Element "file" has checkouts.
In my branch, in my view, these files are not checked out. However I can find some checkout with ct lsco file in other branches.
Why do I get an error. Removing a file from my branch shouldn't affect the other branches, right?
Can I force the command with -f ?
You could try the -force option for the cleartool rmname command, to get past the fact there are other versions checked out. But that -force option might not be available (depending on the cleartool version)
I have seen that option in "Cleartool removing a checkedout file from a folder with rmname" for rmname.
If rmname -f works, then it is the way to proceed.
That error message is more about warning the users that, while the file won't be visible anymore, it is still being modified elsewhere.
Four months ago a colleague had a shapshot view that he deleted from the file system while there were still directory checkouts on a certain branch, say branch 'A'. Now some of directories are obsolete and need to be rmname'd from other views, but this cannot happen apparently while they are still checked out on branch A.
What is the most direct way to unco these directories on branch a?
You can unregister completely this view (even if the actual view is gone from the filesystem).
See "ClearCase: Is it possible to cancel checkouts not made from your own view?":
cleartool rmview -force -uuid (uuid_of_the_view) -vob \aVob
That will trigger, as a side-effect, the removal of the checkout status of any file checked out by this view (referenced by its uuid) in this vob (the -vob option).
See more at "How to delete clearcase views created by other users?":
cleartool lsview -l theViewToRemove # get its uuid
cleartool rmtag -view theViewToRemove
cleartool unregister -view -uuid uuid_of_viewToRemove
You even can use the nuke_view.pl script.
Now some of directories are obsolete and need to be rmname'd from other views, but this cannot happen apparently while they are still checked out on branch A.
As I mention in "How do delete a file in ClearCase?", even if you don't unregister the view, you can still remove a file from a branch, even if it is checked out in another branch.
You simply need to do it from the command-line:
cleartool rmname -force /path/to/file
Eric Schnipke proposes in the comments:
(1) cleartool lsview -l theViewToRemove to get the view's UUID and then
(2) cleartool rmview -force -uuid (uuid_of_the_view) -vob \aVob to remove the view and offending file version.
I could not find the proper command to apply a label to files which are in my current view. I have tried the following command:
cleartool mklabel -r TEST_LABEL /vob/test/a
However, the problem is that this command will apply the "Test_Label" label to every files in the "vob/test/a" directories regardless of whether the files are in my current view.
Is there any command to apply label only to the files listed in my current view?
cleartool mklabel -r(ecurse) LABEL_NAME <directory name>
This command will apply LABEL_NAME to all files in folder and below of your view, you can just go to that directory,then type following command to create and apply label
> cd /vob/test/a
> cleartool mklbtype –nc TEST_LABEL
> cleartool mklabel -r TEST_LABEL .
The mklabel documentation state states, as to what version is labeled:
Processes the entire subtree of each pname that is a directory element (including pname itself). VOB symbolic links are not traversed during the recursive descent into the subtree.
One example mentions:
Attach that label to the version of the current directory selected by your view, and to the currently selected version of each element in and below the current directory.
Now, if you want to be really sure of the versions actually labelled, one solution is to use a find command, combined with your mklabel:
cleartool find . -cview -exec "cleartool mklabel TEST_LABEL \"%CLEARCASE_XPN%\""
If you had already that label applied to incorrect version and want to move it:
cleartool find . -cview -exec "cleartool mklabel -replace TEST_LABEL \"%CLEARCASE_XPN%\""
That way, you can first list the versions involved:
cleartool find . -cview -print
And then, if you agree with the output, apply the mklabel through the -exec directive.
The OP user1096966 reports making it work with a cleartool ls, to be sure to select only element visible in the current view:
cleartool ls -r -vis
The is no '-exec' directive, so a pipe might be involved, as in (not tested, but you get the idea):
cleartool ls -r -vis -s -nxn | xargs cleartool mklabel -replace TEST_LABEL
The doco is really clear about what is being labelled, in fact the first example shown in doco states that exactly...current view objects are labelled by default & currently selected versions (i.e. if in your view then label it, else not.)
....extract below from doco below (note: context and command and that label-type-selector pname is the last parameter...left blank below because resident in working dir)...
Example:
•Create a label type named REL6. Attach that label to the version of the current directory selected by your view, and to the currently selected version of each element in and below the current directory.
cmd-context> mklbtype –nc REL6
Regards
Jim2
I use ClearCase. How can I find out who's checked out a given file?
That kind of request is often prompted when you try to rmname (DEL) a file through the GUI.
If the file is checked-out in any other branch or any other view... the GUI will refuse to rmname the file!
To quickly see where the file is checked-out, try a
ct lsvtree myFile
and look (or grep) for "CHECKEDOUT" string.
You will se one or several line like:
path\to\myFile##\main\aBranch\CHECKEDOUT view "aViewTag"
But remember: you can also force a rmname through the CLI (Command-Line Interface) cleartool.
Assuming you are in the correct path of the file:
cleartool co -nc .
cleartool rmname -force myFile
cleartool ci -nc .
the -force option (not available through GUI) will allow you to rmname your file even if it is already checked-out in another view/branch.
Just do a cleartool lsco on the file element:
%cleartool lsco <element_name>
I would like to get contents of some stream or project I can find in clearcase project explorer.
2... 1
cleartool descr -l project:myProject#\myPVob
with some grep, you have the list of components (writable or not) and policies.
If you want only the Streams:
cleartool lsproj -tree myProject#\myPVob
You can repeat that for a Stream (to get the sub-streams)
cleartool lsstream -tree myStream#\myPVob
For the foundation baselines of a Stream:
cleartool descr -fmt "%[mod_comps]CXp" stream:myStream#\ideapvob
For the activities of a Stream:
cleartool descr -fmt "%[activities]CXp" stream:myStream#\ideapvob
If you want to consult the files (i.e. the exact version of each files) referenced by a stream, the quickest way would be to create a UCM dynamic view on that stream:
cleartool mkview -tag myView_myStream -stream myStream#\myPVob -stg myStorage
With a dynmic view, you will not have any load rule (since it is a dynamic view).
You only need to mount the VOB which you want to see
cleartool mount \myVob
And you can start browsing the files
M:\myView_myStream\myVob\...
For snapshot view, see "Proper ‘cleartool mkview’ for ClearCase Snapshot view creation"
mkview -snapshot -tag myView_myStream_snap -vws \\mySharedPath\myView_myStream_snap.vws -host myHostname -hpath \\mySharedPath\myView_myStream_snap.vws -gpath \\mySharedPath\myView_myStream_snap.vws myRootDir
For the load rules, see:
Config specs and Load rules difference