Cleartool - find unloaded/removed files
Asked Answered
C

1

2

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

Thanks

Chilon answered 27/7, 2012 at 21:23 Comment(0)
C
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.

Corkhill answered 27/7, 2012 at 22:24 Comment(8)
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 branchChilon
@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.Corkhill
The ... wildcard link is now stale. Use this instead (for CC 8.0.1): www-01.ibm.com/support/knowledgecenter/SSSH27_8.0.1/…Hesitate
@Hesitate thank you, I have updated the other links as well.Corkhill
@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?Fineness
@Fineness Sorry, I left some minus in the answer, instead of hyphen-minus: https://mcmap.net/q/11577/-what-39-s-the-toughest-bug-you-ever-found-and-fixed-closed. If you copy-pasted and then changed the command, you need to change the '-' from –print to -print: '' is not the same as '-'...Corkhill
@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?Fineness
@Fineness Check this thread: ibm.com/developerworks/community/forums/html/… : you might need to add a version in there, like LATEST: .../mybranch/LATESTCorkhill

© 2022 - 2024 — McMap. All rights reserved.