aspose file tools*
The moose likes Ant, Maven and Other Build Tools and the fly likes cvstagdiff -- how to use -kk option in ANT build.xml file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "cvstagdiff -- how to use -kk option in ANT build.xml file " Watch "cvstagdiff -- how to use -kk option in ANT build.xml file " New topic
Author

cvstagdiff -- how to use -kk option in ANT build.xml file

Arun Sangal
Greenhorn

Joined: Aug 22, 2008
Posts: 4
Hi All,

I want to generate differences between two given tags (i.e. a start tag and end tag). :roll:

Currently I'm using the following code in build.xml:

....
some code here
......
<target name="-tagdiff" if="is.tag.type">
<cvstagdiff cvsRoot=" server:gigabuild@giga.repos-cvs.com:/mnt/cvs/cvsroot/${repository}"
destfile="xml/${component}-diff.xml"
package="${module}"
startTag="${start.tag}"
endTag="${end.tag}"
passfile=".cvspass">
<commandline>
<argument value="-kk"/>
</commandline>
</cvstagdiff>
<style in="xml/${component}-diff.xml"
out="report_${start.tag}_${end.tag}/${product}/${component}-diff.html"
style="tagdiff.xsl">

</style>
</target>

......
some code here
....

I'm getting an error mesg while running "ant" using this build.xml. It's saying... unknown "-k" option.

Can't I use these lines:

<commandline>
<argument value="-kk"/>
</commandline>

with "cvstagdiff" ???

NOTE:

1) -kk option is used with rdiff command to ignore CVS's own variable while comparing files with two diff versions i.e. it just checks changes if there are any in the actual code body (instead of any CVS variable's expanded value within the code's comment area).
2) Value for start.tag and end.tag are coming from a property file i.e. build.properties
3) When I'm removing the above 3 lines, diff reports are generating good but showing files has changes even if the changes are just due to CVS's own variable expansion.
4) cvstagdiff intuns calls rdiff


Any help will be appreciated.
thanks-

Brgds,
Arun Sangal
303 397 6059Brgds, Arun Sangal SCM | 1-(303) 397 6059 arun.sangal@galileo.com


Arun Sangal<br />SCM - 303 397 6059<br />arun.sangal@galileo.com
Arun Sangal
Greenhorn

Joined: Aug 22, 2008
Posts: 4
Can anyone please help. Thanks-
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5823
    
    7

I don't use CVS, so this is all guesswork. But from reading about the CVS-related tasks in the Ant docs, my guess is that if you give commandline arguments, then they must be the full argument to the cvs task, not just the optional argument for the rdiff function.

Try this, run the cvstagdiff task without any commandline arguments. Run Ant with the -verbose option; Ant should provide the cvs command line it runs. Then add the commandline argument back in, providing all of the arguments, adding the -kk in where it should go.

If this does not help, provide the full command line output for the Ant task, including the Ant command with -verbose.


JBoss In Action
Arun Sangal
Greenhorn

Joined: Aug 22, 2008
Posts: 4
Getting this...diff which is only due to $<variable>?$ expansion.

/projects/stp/home/build/dk/aks
[tpuser@build]$ tamanager/UalHeaderOverrider.java <
Index: stp/hostaccess/HostAccessService/src/com/cendant/tds/galileo/hostaccessservice/datamanager/UalHeaderOverrider.java
diff -c stp/hostaccess/HostAccessService/src/com/cendant/tds/galileo/hostaccessservice/datamanager/UalHeaderOverrider.java:1.5.2.1.4.1 stp/hostaccess/HostAccessService/src/com/cendant/tds/galileo/hostaccessservice/datamanager/UalHeaderOverrider.java:1.7
*** stp/hostaccess/HostAccessService/src/com/cendant/tds/galileo/hostaccessservice/datamanager/UalHeaderOverrider.java:1.5.2.1.4.1 Wed Jul 9 02:58:23 2008
--- stp/hostaccess/HostAccessService/src/com/cendant/tds/galileo/hostaccessservice/datamanager/UalHeaderOverrider.java Sat Jul 19 07:48:31 2008
***************
*** 15,20 ****
--- 15,23 ----
* @author JArm (c0*3714)
* $Source$
* $Log$
+ * Revision 1.7 2008/07/19 07:48:31 e027449
+ * Replacing from 8.4.0 RC01 for preparing GOLD branch
+ *
* Revision 1.5.2.1.4.1 2008/07/09 02:58:23 c003714
* Fixed Custom Session Timeout logic to properly collect the Session files....Merge into release
*
[tpuser@build]$

[tpuser@build]$ history|tail -1
35 cvs -d server:build@cvskeeper:/mnt/cvs/soa-cvsroot/services rdiff -kk -r STP_08_04_00_RC01 -r GOLD_08_04_00 stp/hostaccess/HostAccessService/src/com/cendant/tds/galileo/hostaccessservice/datamanager/UalHeaderOverrider.java

[tpuser@build]$



Here I'm just doing a RDIFF to see differences.

Do I need to make sure that for seeing only the code differences (actual differences), I have to ask the developer/contributor to use -kk while checking out, and then making his/her change and then commit it. Then I have to use -kk with rdiff command???


am i correct or is -kk not working?

arun sangal
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5823
    
    7

I don't see any ant run, or output from an ant run, in your latest post, so I have no idea.

Also, I do not understand this sentence:

Getting this...diff which is only due to $<variable>?$ expansion.


Are you talking about a 'diff' command or did you mean 'rdiff'? And how is that command related to the text "$<variable>?$" and the expansion of that text? (And I don't see "$<variable>?$" anywhere in the following text.)
[ September 09, 2008: Message edited by: Peter Johnson ]
Arun Sangal
Greenhorn

Joined: Aug 22, 2008
Posts: 4
cvstagdiff is an ANT task which calls rdiff instead of diff. In my build.xml file I'm calling cvstagdiff task which inturns call rdiff command and work on all the repositories (listed under the build.xml file).

I just pasted the output that rdiff command is showing me when I'm using rdiff -kk -r tag1 -r tag2 on that file. The lines have "+" sign as the first character are the lines which got added as a commit onto that file which is just an example of committing a code (not the actual code) but in the commented part which is just a change due to keyword expansion.

I just want to know what option shall i use with RDIFF (I don't have to use DIFF command) command in CVS so that I'll not see that output. the output should be blank as those changes are not CODE changes but only due to keyword expansion.
gigaaks ska
Greenhorn

Joined: Jan 10, 2012
Posts: 1
OK... here is the solution.

1. find out the class within the ANT jar files which contain cvstagdiff.
2. see the class using "cavaj" which is opposite of "javac". Its a freeware and unlocks a class into JAVA code.
3. See the .java file which has the entry for cvstagdiff
4. Make changes to the funtion in java code for cvstagdiff. change will be similar to adding a "-kk" option like one of the other option (you'll be able to find it easily if you see the code).
MAKE sure you rename the function as "cvstagdiff1". Javac it again and now you'll get a new class. Put this jar in "ant_custom.jar" and place a copy under ~user/.ant/lib folder where user is a Linux/Unix user who;ll be running a script/call to this
cvstagdiff1 task using a .sh or ANT code
5. Make changes to your ANT build.xml i.e instead of using cvstagdiff it now use: cvstagdiff1
6. you may have to use classpath while calling the main target in your ANT build.xml i.e. ANT should know where it can find cvstagdiff1 ant task.

7. If the above seems like a little difficult for you, just send me an email: arun.sangal@travelport.com and i'll help you out. Its very easy.
Now, when I run diff script (shell) which calls ANT code (build.xml), the CVS rdiff command show "-kk" in ANT's verbose output. The diff reports now doesn't show any file where changes happens due to CVS variables only (except for file which has $LOG cvs variable). It's CVS issue that -kk can't ignore $LOG cvs variable)... so if a file has $source $id $date etc then that file will not show as a diff file between two tags/branches but if that file has $LOG, it'll still show in diff reports even if -kk was used.

I have the ant_custom.jar file (containing the java class (cavajed+changed+javaced again) that you can just use. I have the build.xml that you can use for your help.


regards
Arun Sangal
Work: arun.sangal@travelport.com
Personal: sangal.ak04@gmail.com
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: cvstagdiff -- how to use -kk option in ANT build.xml file