Cleartool - find unloaded/removed files - clearcase

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.

Related

Is it possible to remove the label from entire version tree?

From every branch and node.
Not only in branch of current view.
I have tried using "cleartool rmlabel -rec YOUR_LABEL yourDirectory" . but it removes only current view of version.
You can try instead to remove the entire label type:
cleartool rmtype -rmall yourlabel#\avob
But be careful, that would remove all instances of that label anywhere in that repo.
See another example of rmtype with "How to delete a clearcase branch with a single command?" using find and cleartool rmlabel.
Since you don't want to remove the label in the all vob, only in a given folder, you need to apply a slower solution, searching files with that label in your folder and subfolders:
cd /path/to/your/folder
cleartool find . -version "{lbtype(LABEL)}" -print
If the above line do print version for files in your folder and your subfolder, then try:
cd /path/to/your/folder
cleartool find . -version "{lbtype(LABEL)}" -exec "cleartool rmlabel YOUR_LABEL \"%CLEARCASE_XPN%\""

Clearcase Findmerge

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 to find list of files created and modified in a UCM stream?

Whenever developer tries to debug the code they wanted to know list of files created and modified from particular day . I use
cleartool find command with created_since , but it finds only the files which are created not modified.
How to find both?
The cleartool find command can give you what you want, provided you look for versions created since a date, not element (file or directory).
See "Additional examples of the cleartool find command":
cleartool find <vobtag> -version "{created_since(target-data-time)}" -print
Since you are in UCM, you can limit that search to a specific branch name (corresponding to a specific Stream)
cleartool find <vobtag> -version "{brtype(BRANCH) && created_since(target-data-time)}" -print
Add the user in this request:
cleartool find <vobtag> -version "{created_by(user2) && brtype(BRANCH) && created_since(target-data-time)}" -print
And you should get what you need for a developer for a given Stream and date.
Below is example of finding all files changed after 27-Aug-2014
cleartool find . -version "{created_since(27-Aug-2014)}" -print
I followed what brainimus had to say here.
IBM Clear Case-> Administration -> Report builder.
In the Tree view Under \Reports Select Elements, and then choose the appropriate option.

How to display recent changes and logs for current view spec in clearcase?

newbie for clearcase.
Since clearcase's config is rather different from other concept in git, I may mean logs for
any files with specified version/branch path.
Like I want to show log for all element match:
element * .../specified-lable-or-branch/
First you need to be aware of the differences between ClearCase and Git, ClearCase being file-centric (no notion of repository-wide revision or commit)
You can display logs for any visible file by typing:
cleartool lshistory /myView/myVob/path/to/myFile
See lshistory man page. (and also How do I understand about ClearCase event records in the VOB database)
The lshistory command lists event records in reverse chronological order, describing operations that have affected a VOB's data.
File system data history.
Lists events concerning elements, branches, versions, and VOB links.
This includes records for creation and deletion of objects, and records for attaching and removal of annotations: version labels, attributes, and hyperlinks.
Another kind of logs is the lsvtree (history of versions):
The lsvtree command lists part or all of the version tree of one or more elements.
By default, the listing includes all branches of an element's version tree except for obsolete branches.
alt text http://youtrack.jetbrains.net/_persistent/tree.PNG?file=74-3724&v=1&c=true
The OP adds:
How can I display all history for elements match a pattern like has new version under a branch?
You can combine almost any commands with a find query.
Windows syntax:
cleartool find . -name "apattern" -exec "cleartool lshistory \"%CLEARCASE_PN%\""
cleartool find . -version "{created_since(target-data-time)}" -exec "cleartool lshistory \"%CLEARCASE_PN%\""
Unix syntax:
cleartool find . -name "apattern" -exec 'cleartool lshistory "$CLEARCASE_PN"'
cleartool find . -version "{created_since(target-data-time)}" -exec 'cleartool lshistory "$CLEARCASE_PN"'
For the " like has new version under a branch?" specifically:
cleartool find . -version "brtype(mybranch)" -exec ...
should do it (any element which has no version created for that branch will not be listed).

find files in clearcase

situation:
one vob, 2 views (main dev and branch view).
i need to find all files that where created in the branch view and therefore can't be found via merge manager.
anyone able to help?
thanks
When it comes to cleartool find, the two sources of information and example I recommend are:
SAMECS find command
IBM find examples
In your case:
cleartool find -all -ele "brtype(mybranch) && !brtype(main)" -print
(supposing "main dev" means "branch 'main'")
cleartool find -all -type f -ele "brtype(mybranch) && !brtype(main)" -print
would limit that to files only (not directories)

Resources