tags:

views:

141

answers:

1

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/
+2  A: 

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


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).

VonC
How can I display all history for elements match a pattern like has new version under a branch?
arsane
Cool! Thanks a lot!
arsane