I have a branch B1 and another branch B2. I want all files/subfolders (recursively) inside a particular folder X (and not on entire VOB) on B1 to be merged onto B2.
What exact findmerge command do I need to use?
The below commands will work for entire vob or if I run them by getting into the directory in question, that will suffice for me?
cleartool findmerge . -type dir -nc -fver .../dev/LATEST -merge
cleartool findmerge . -nc -type file -fver .../dev/LATEST -print
Thanks a lot in advance.
After checkin the findmerge man page:
You shouldn't need to merge first the directories, then the files.
findmerge should do the right merges (directories, then files) all by itself.
cleartool findmerge . -nc -fver .../dev/LATEST -merge
should be enough.
cleartool findmerge . -nc -fver .../dev/LATEST -print
will print what needs to be merged, but will stop at the directories.
Related
I am new to cleartool.
I did some changes in .cs files from main latest.
I have to copy those changes in particular branch.
I have tried this command
cleartool find . -all -nvisible -name "*" -version "{created_by(mayur_shingote) && created_since(01-Sep-2017)}" -print
I want to find all the files that have been changed on a label (eg label1) from my view. label1 Can be be applicable to multiple branches as well.
I tried following command, it did not work:
cleartool findmerge . -fve "{lbtype(label 1)}" -print
What would be the correct command?
If you want to find all the files that are labelled 'label1', a cleartool find would be more adequate than cleartool findmerge.
cleartool find . –version 'lbtype(label1)' -print
For listing the files (and not their versions) on all branches:
cleartool find -all -element '{lbtype_sub(label1)}'
See also:
"Additional examples of the cleartool find command"
"cleartool find examples"
How can we print only the directories of branch latest in clearcase .
You can use a cleartool find command in your view (which already selects the right version, like the LATEST from a branch):
cleartool find -type d -print
The '-type d' option will restrict the search for directory elements only.
More generally, in any view, you can try (see "general examples")
cleartool find . -type d -version version(.../yourBranch/LATEST) -print
# or
cleartool find . -type d -element version(.../yourBranch/LATEST) -print
The .../ notation allows you to search for a version in yourBranch, without having to specify parent branches (like /main/yourBranch or /main/anotherBranch/yourBranch)
If you want just the name, and or more details, use the fmt_ccase in a cleartool describe command:
Replace the -print with
# Windows syntax
-exec "cleartool descr -fmt \"%n\n\" \"%CLEARCASE_PN%\""
# Unix syntax
-exec 'cleartool descr -fmt "%n\n" "$CLEARCASE_PN"'
Is there a command in Cleartool which i can use to list all files which have been removed from a branch?
Thanks
The basic command to find anything in ClearCase is... cleartool find, also illustrated in "ClearCase UCM: Need to See Content of Deleted File".
In your case, you would search for versions of files which aren't at the LATEST of a branch:
cleartool find . -type f -version "! version(.../BRANCH/LATEST)" -print
(see version selector for more on this '.../' notation)
To display only the file (and not all the versions):
cleartool find . -type f -element "! version(.../BRANCH/LATEST)" -print
The OP linuxlewis mentions in the comments:
this will show all differences which exist between sibling branches. I just want to be able see the file names,if any were removed,from the current branch
I mention the possibility of a grep for BRANCH, to detect files which have versions in BRANCH but not LATEST)
However, a cleaner solution is to add another filter to the search: && version(.../BRANCH)
cleartool find . -type f -element "! version(.../BRANCH/LATEST) && version(.../BRANCH)" -print
That will search all "elements" (files or directories in ClearCase) which have versions in branch BRANCH, but not one in BRANCH/LATEST.
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>