2

Is there a command in Cleartool which i can use to list all files which have been removed from a branch?

Thanks

cdugga
  • 3,849
  • 17
  • 81
  • 127

1 Answers1

5

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.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • ok but 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 – cdugga Jul 28 '12 at 06:44
  • 2
    @linuxlewis you can grep for `BRANCH` (if it has version in `BRANCH` but not `LATEST`), it is a file for you. Or you can add a '`&& version(.../BRANCH)` which should select all elements with versions in `BRANCH` without a version in `BRANCH/LATEST`. – VonC Jul 28 '12 at 07:35
  • The ... wildcard link is now stale. Use this instead (for CC 8.0.1): http://www-01.ibm.com/support/knowledgecenter/SSSH27_8.0.1/com.ibm.rational.clearcase.cc_ref.doc/topics/wildcards_ccase.htm – GergelyPolonkai Jan 07 '15 at 10:52
  • @GergelyPolonkai thank you, I have updated the other links as well. – VonC Jan 07 '15 at 11:32
  • @VonC: Hi, i've tried the cmd "cleartool find . -type f -element "! version(.../BRANCH/LATEST) && version(.../BRANCH)" –print" but I only get the error message: cleartool: Error: Extra arguments: "-print". Did the command syntax change? – airborne Feb 01 '18 at 10:33
  • 1
    @airborne Sorry, I left some minus in the answer, instead of hyphen-minus: https://stackoverflow.com/a/170148/6309. If you copy-pasted and then changed the command, you need to change the '`-`' from `–print` to `-print`: '`–`' is not the same as '`-`'... – VonC Feb 01 '18 at 10:37
  • @VonC: Sorry to bother you again. "cleartool find . -type f -element "version(.../mybranch/LATEST)" -print" works for me, but "cleartool find . -type f -element "version(.../mybranch)" throws an "cleartool: Error: Malformed branch pathname: "\..."." Any idea what I'm still doing wrong? – airborne Feb 01 '18 at 14:38
  • @airborne Check this thread: https://www.ibm.com/developerworks/community/forums/html/topic?id=77777777-0000-0000-0000-000013792593&ps=100&tags=&query=&filter= : you might need to add a version in there, like LATEST: `.../mybranch/LATEST` – VonC Feb 01 '18 at 14:52