what is the clearcase command to backup predecessor version of a file ?
You can try cleartool get to copy any old version of a file into a temporary file.
cleartool get –to C:\build\foo.c.temp \dev\hello_world\foo.c##\main\2
More generally, the question "In ClearCase, how can I view old version of a file in a static view, from the command line?" will detail all the possibilities to access the content of previous versions of a given file.
Related
For some reason, our company don't support clearcase anymore.So I need to remove it from scripts,use folder to replace it.
For the command
Cleartool setview -exec "$RUN_SCRIPT paramter1 paramter2" $MY_CC_VIEW
$RUN_SCRIPT=/vobs/sw/ecomps/tools/script_remote.sh (a script located in view path)
how to replace it?
cd a path that script located in ,then execute the command?
cd $MY_CC_VIEW_PATH/vobs/sw/ecomps && tools/script_remote.sh paramter1 paramter2
cleartool setview is for setting the view content of dynamic views, so if ClearCase is not running anymore, you would not be able to access any dynamic view anyway.
As I mentioned in "Python and ClearCase setview", never use setview in a script anyway: always use the full /view/viewTag/vobs/aVobTag/... path.
But again, if ClearCase is stopped, that dynamic view path would not be accessible: you should at least checkout snapshot views, whose content would remain accessible even if there is no ClearCase server running.
I am new to clear case. Our organizations code is versioned using clear case and I have to edit some code. The codes are database .ddl file. so 2 .ddl files for a package.
I have checked out the pieces of code that I have to use. But I can not see them anywhere. I have checked the FTP client I am using, as well as my local.
Now I am confused about two parts:
After checking out do I copy the .ddl files from the current location to my clearcase home and then download them to pc and use them? That is what I am doing right now.
or is there any other way to generate the ddl files from PL/SQL developer?
I can see the package and package body but can not find the .ddl files.
here I am attaching the clearcase terminal commands and responses:
denoad32:ddl $ cleartool lsco -me
--04-03T03:02 Sayan.Sikdar checkout version "XXONT_OH_REL_SC_HOLD_PB.ddl" from /main/R12/8 (reserved)
--04-03T03:02 Sayan.Sikdar checkout version "XXONT_OH_REL_SC_HOLD_PS.ddl" from /main/R12/3 (reserved)
What I am doing right now is I have check the files out. Now that I have checked the files out I am copying it from their current location to my view home. Then I am downloading it and using it.
Basically, you have checked out the files with the command "cleartool co ". in order to be able to access the files, you need to be inside your Clearcase view. If you are in the same session as when you performed the check out, you should have access to the files you have checked out.
The usual workflow is :
checkout the file
modify and save the file
checkin the file
All these must be done inside a Clearcase view.
download them to pc and use them?
If your PC has a ClearCase Client, it can host a ClearCase view (snapshot or dynamic) and will download automatically checked out files.
is there any other way to generate the ddl files from PL/SQL developer
If there is, that would explain why you don't see those files: they can be generated.
pg_dump -U user_name -h host database -s -t table_or_view_names -f table_or_view_names.sql
How to Copy the directory and its contents from local file system to VOB (Source control)
I know there are commands (mkdir, mkelem) to create directory , elements and copy the files one by one.
But I would like to know is there any easy way to do this as there are thousands of sub directories and files inside parent directory?
Yes: you can use clearfsimport, which is made precisely for that.
It will do the mkdir, and cleartool mkelem (or cleartool checkout if you import new versions on top of existing versioned elements)
See also "How can I use ClearCase to “add to source control …” recursively?":
clearfsimport -preview -rec -nset c:\sourceDir\* m:\MyView\MyVob\MyDestinationDirectory
About the clearfsimport options used here, see "Creating a new subdirectory structure in ClearCase?".
I need to get the version (entire version like main/branch1/branch2/1) of a particular file using ClearCase tool or java code.
Can some one please help me on this ?
The command to use is cleartool get:
On a UNIX or Linux system, copy /dev/hello_world/foo.c##/main/2 into the current directory.
cleartool get -to foo.c.temp /dev/hello_world/foo.c##/main/2
On a Windows system, copy \dev\hello_world\foo.c##\main\2 into the C:\build directory.
cleartool get -to C:\build\foo.c.temp \dev\hello_world\foo.c##\main\2
You can see more at "In ClearCase, how can I view old version of a file in a static view, from the command line?":
cleartool get don't do stdout (it only copies to a file)
in a dynamic view, you can directly access any version you want
cd /view/MyView/vobs/myVobs/myPath/myFile##/main/[...]/maBranch
cat 1
In the ClearCase Remote Client is it possible to find a list of all hijacked files in a given view?
Right-click on your view and select Show Pending Changes. All of your hijacked files will be displayed at the top of the list under the heading Hijacked Resources.
It's also possible through the UI, albeit indirectly.
If you run "Refresh > Update from Repository..." off the context menu, the UI will present you with a list of files it did not update upon completion. This will include all hijacked files.
If you're looking to check out the hijacked files, you can select them all and check them out from that display.
In a snapshot view, it is possible to do so using 'cleartool ls -recurse | grep hijacked' (Unix/Linux) or 'cleartool ls -recurse | findstr "hijacked"' (for Windows)
See the link Identifying hijacked files in a snapshot view
In a Web view or CCRC view, I would think that you should be able to do the same if you have installed rcleartool.
The command "rcleartool ls -recurse | grep hijacked" should work the same way.
Note: Depending on the version of CC on your server, rcleartool you need to use is either a separate zip or either included in the CCRC rich client. It is not included by default in the CCRC plugin for eclipse.
Detecting hijacked files in a web or CCRC view can be tricky, depending on the state of the view itself.
For instance, the .COPYAREA.DB file, if missing or corrupt, means that all or some of the loaded files will appear to be hijacked. (see "About the .copyarea.dat and .copyarea.db files")
Other bugs (swg1PK64597, swg21433085) can affect the list of hijacked files as well, depending on your ClearCase version and your OS.
Another way to list hijacked files it to look for "skipped object" after an rcleartool update:
rcleartool update -noverwrite
(with -nov/erwrite leaving all hijacked files in the view with their current modifications)
Hijacking an element in a snapshot view involves making it writable and making a change to it. There is no lshijack or lsprivate -hijacked command to list the files. While the cleartool update operation does generate a log identifying hijacked files, the best way is to use cleartool ls command which identifies hijacked versions in much less time than an update would take.
Use cleartool ls from the command line and look for the [hijacked] tag on objects.
Example output:
%> cleartool ls
archive.ppt##\main\1 [hijacked] Rule: \main\LATEST
project.doc##\main\1 Rule: \main\LATEST
doc_resources.ppt##\main\2 [hijacked] Rule: \main\LATEST
To obtain a list of all hijacked files in a snapshot view, use the following command:
On UNIX® and Linux® you can run the following command from a snapshot view:
cleartool ls -recurse | grep "hijacked"
On Microsoft® Windows® you can run the following command from a snapshot view:
cleartool ls -recurse | findstr "hijacked"
This command will perform a recursive "cleartool ls" and then use "grep" or
"findstr"command respectively to filter any lines that have the [hijacked] line associated with them.
Note: GREP is a native UNIX command; however, it can be run on Windows if the utility is installed. The grep tool comes with applications like GNU, Free Software Foundation or Cygwin