Sunday, December 5, 2010

Difference between two versions in ClearCase dynamic view

For dynamic views, you can use the extended pathnames with cleartool diff.

This help page "To compare with a version other than the predecessor " gives all the details:

cleartool diff prog.c prog.c@@\main\4

cleartool diff won't give you exactly what you want if you look only for a summary (displaying only the number of lines added, removed and changed):

The default file-comparison report begins with a file summary, which lists all the input files and their assignments as file 1, file 2, and so on.
If no differences are detected among the files, this listing is replaced by the message Files are identical.

The remainder of the report is a series of pairwise differences, each of which is preceded by a descriptive header line:

******************************** (file summary)<<< file 1: util.c@@/main/1>>> file 2: util.c@@/main/3********************************----------[after 15]------|-------[inserted 16]------ (header) | char *s; (difference) |----------[changed 18]-----|----[changed to 19-21]---- (header)return ctime(&clock); | s = ctime(&clock); (difference) - | s[ strlen(s)-1 ] = '\0'; | return s; |-

Note:

report with x lines added , y lines deleted , z lines changed between two versions

No, not with cleartool diff: the diff format doesn't include a pure summary style.

But since you can access to any two versions in a dynamic view, you can use any diff tool you want to achieve that particular output.


View the original article here

1 comment:

  1. If you need LoC (Lines of Code) metrics for ClearCase, you can use R&D Reporter: http://gomidjets.com/rnd

    ReplyDelete