Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to find the files modified under a clearcase branch

Tags:

I modified and checked-in a bunch of files under my branch. Now I need to get the list of files I modified. Is there any scripts to do so?

like image 289
sarat Avatar asked Apr 27 '11 07:04

sarat


People also ask

How do I search for a file with label in ClearCase?

There is also a graphical way to find objects with a certain label called Report Builder (also known in ClearCase Explorer as Report Wizard). In Report Builder you can navigate to Elements/Labels which has the "Elements with Labels" and "Versions with Labels" reports.

How do I find my branch in ClearCase?

If you are using Windows ClearCase 'Report Builder' can be used to find all elements with a given branch name, as well as the option to find the latest version number (explicit element).

How do I delete a branch in ClearCase?

You can try and delete the byrtpe (branch type) with cleartool rmtype brtype:xxx .


1 Answers

The cleartool command find should help you find any element (file) with at least one version on a given branch.

The following will find all the files on a branch

cleartool find . -type f -branch "brtype(mybranch)" -print

See find examples or "Additional examples of the cleartool find command" for more examples.


The OP sarath adds:

it gives me a crippled file name with @ and other characters. Is it possible to get with normal path?

True, such a command would give you something like (as an example):

.\.checkstyle@@\main\MyBranch
.\.classpath@@\main\MyBranch_Int\MyBranch
.\.classycle@@\main\MyBranch_Int\MyBranch
.\.fbprefs@@\main\MyBranch_Int\MyBranch

To get only the path, you have two solutions:

1/ look for elements (and not versions) with the right branch:

cleartool find . -type f -ele "brtype(mybranch)" -print

(note the -ele replacing the -branch)
That would give:

.\.checkstyle@@
.\.classpath@@
.\.classycle@@
.\.fbprefs@@
.\.pmd@@

But you still have the "ugly" '@@'.

2/ combine the find with an exec directive which describe the element found with fmt_ccase format:

cleartool find . -type f -ele "brtype(mybranch)" -exec "cleartool descr -fmt \"%En\n\" \"%CLEARCASE_PN%\""

Multi-line form for readability:

cleartool find . -type f -ele "brtype(mybranch)" \
  -exec "cleartool descr -fmt \"%En\n\" \"%CLEARCASE_PN%\""

Please note that all "inner" double quotes need to be escaped.

The %En will give you the name of the element found.

.\.checkstyle
.\.classpath
.\.classycle
.\.fbprefs
.\.pmd
.\.project
.\.settings\dico.txt
like image 55
VonC Avatar answered Oct 21 '22 08:10

VonC