Showing posts with label between. Show all posts
Showing posts with label between. Show all posts

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

count lines of code between two versions

You can as VonC suggest use two different views. Alternatively you can use the file@@version syntax to access both versions directly if you know exactly what you are looking for. Two views are probably the best option if you are going to automate something (which implementing something in java suggests to me).

When you say "compare lines of code between two clearcase versions" I assume you are looking for something other than the standard cleartool diff (btw, KDiff3 is an excellent diff utility which have clearcase integration, I highly reccommend it), and assume it is more in the "count number of lines" direction you are looking.

However just counting difference in lines will only give limited information, usually it is also interesting to know if the lines that constitutes the difference are mostly added or removed. To give this kind of information you can use diffstat (see this answer for example output).

At my last job I wrote a java gui for running

diff -u file@@/main/branch1/LABEL1 file@@/main/branch2/LABEL2 | diffstat

given two labels, iterating over several files, but I then depended on bash, diff and diffstat from cygwin, I am not aware of any pure java alternatives here.


View the original article here

Wednesday, November 10, 2010

Re: How to find changes occured between labels applies. In snapshot context.


Posts: 3
Registered: Aug 25, 2010 09:20:27 AM How to find changes occured between labels applies. In snapshot context.
Posted: Nov 05, 2010 07:02:22 AM Hi,
I have some file in VOB and they have labels. Ex.
\file.txt@@\main\5 with label MyLABEL_v1
\file.txt@@\main\10 with label MyLABEL_v2
and main latest is ex \main\20
I would like to list all versions between those with MyLABEL_v1 and MyLABEL_v2
so expected results are:
\file.txt@@\main\6
\file.txt@@\main\7
\file.txt@@\main\8
\file.txt@@\main\9
\file.txt@@\main\10

Second requirement is that I need this list for each file in current snapshot view. It is critical.

I can also rely on dates instead of labels. But when I provide in cleartool commands like:

find E:\myView\MyVOB -version "created_since(2010-10-27T09:13:08+02:00) && (! created_since(2010-11-01T09:13:08+02:00)) " -print

Returned list seems to be OK but contains informations about files which are not loaded to my view.


Posts: 65
Registered: Nov 17, 2006 05:38:41 AM Re: How to find changes occured between labels applies. In snapshot context.
Posted: Nov 08, 2010 08:40:47 AM   in response to: JanRoman in response to: JanRoman's post If you use the solution with created_since, try to add the option -visible (selects only elements that are visible in your view). However the option created_since does not guarantee that you will get what you are looking for (you never know when the labels have been applied).

Otherwise, I don't know how you can do your original query in a single cleartool command using labels. I would query for all versions that have the most recent label, and then lookup for each version their predecessor, and then the predecessor's predecessor etc... Until you find the version that has your first label.

Regards,
Marc

Help

Use the search field to find all types of content in My developerWorks with that tag.

Use the slider bar to see more or fewer tags.

Popular tags shows the top tags for this particular type of content or application that you're viewing.

My tags shows your tags for this particular type of content or application that you're viewing.

Use the search field to find all types of content in My developerWorks with that tag. Use the slider bar to see more or fewer tags. Popular tags shows the top tags for this particular type of content or application that you're viewing. My tags shows your tags for this particular type of content or application that you're viewing.MoreLess 
Point your RSS reader here for a feed of the latest messages in all forums

View the original article here

Sunday, November 7, 2010

How to find changes occured between labels applies. In snapshot context.


Posts: 3
Registered: Aug 25, 2010 09:20:27 AM How to find changes occured between labels applies. In snapshot context.
Posted: Nov 05, 2010 07:02:22 AM Hi,
I have some file in VOB and they have labels. Ex.
\file.txt@@\main\5 with label MyLABEL_v1
\file.txt@@\main\10 with label MyLABEL_v2
and main latest is ex \main\20
I would like to list all versions between those with MyLABEL_v1 and MyLABEL_v2
so expected results are:
\file.txt@@\main\6
\file.txt@@\main\7
\file.txt@@\main\8
\file.txt@@\main\9
\file.txt@@\main\10

Second requirement is that I need this list for each file in current snapshot view. It is critical.

I can also rely on dates instead of labels. But when I provide in cleartool commands like:

find E:\myView\MyVOB -version "created_since(2010-10-27T09:13:08+02:00) && (! created_since(2010-11-01T09:13:08+02:00)) " -print

Returned list seems to be OK but contains informations about files which are not loaded to my view.

Help

Use the search field to find all types of content in My developerWorks with that tag.

Use the slider bar to see more or fewer tags.

Popular tags shows the top tags for this particular type of content or application that you're viewing.

My tags shows your tags for this particular type of content or application that you're viewing.

Use the search field to find all types of content in My developerWorks with that tag. Use the slider bar to see more or fewer tags. Popular tags shows the top tags for this particular type of content or application that you're viewing. My tags shows your tags for this particular type of content or application that you're viewing.MoreLess 
Point your RSS reader here for a feed of the latest messages in all forums

View the original article here

Wednesday, November 3, 2010

Count of changed line of code between two tags - by: sumit_lala

Hi,
Is there a way to determine the count of change in lines of code between two tags/branches?
is there a command that can be explored without much of scripting.
svn log looks close, but it still isnt doing what i need, Can this be scripted? is there anything out there already ?
Any open source tools that can do it ?
Please help!
~Sumit
View the original article here

Tuesday, November 2, 2010

Count of changed line of code between two tags - by: sumit_lala

Hi,
Is there a way to determine the count of change in lines of code between two tags/branches?
is there a command that can be explored without much of scripting.
svn log looks close, but it still isnt doing what i need, Can this be scripted? is there anything out there already ?
Any open source tools that can do it ?
Please help!
~Sumit
View the original article here