Author: bodewig
Date: Thu Oct 16 06:42:30 2008
New Revision: 705241

URL: http://svn.apache.org/viewvc?rev=705241&view=rev
Log:
allow cvstagdiff to ignore removed files.  Submitted by Rob van Oostrum.  PR 
26257.

Modified:
    ant/core/trunk/WHATSNEW
    ant/core/trunk/docs/manual/CoreTasks/cvstagdiff.html
    ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/cvslib/CvsTagDiff.java

Modified: ant/core/trunk/WHATSNEW
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/WHATSNEW?rev=705241&r1=705240&r2=705241&view=diff
==============================================================================
--- ant/core/trunk/WHATSNEW (original)
+++ ant/core/trunk/WHATSNEW Thu Oct 16 06:42:30 2008
@@ -453,6 +453,9 @@
 
  * <cvsversion> now works for local repositories as well.
 
+ * <cvstagdiff> has an option to ignore removed files now.
+   Bugzilla Report 26257.
+
 Changes from Ant 1.7.0 TO Ant 1.7.1
 =============================================
 

Modified: ant/core/trunk/docs/manual/CoreTasks/cvstagdiff.html
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/docs/manual/CoreTasks/cvstagdiff.html?rev=705241&r1=705240&r2=705241&view=diff
==============================================================================
--- ant/core/trunk/docs/manual/CoreTasks/cvstagdiff.html (original)
+++ ant/core/trunk/docs/manual/CoreTasks/cvstagdiff.html Thu Oct 16 06:42:30 
2008
@@ -69,6 +69,11 @@
     <td valign="top">The file in which to write the diff report.</td>
     <td align="center" valign="top">Yes</td>
   </tr>
+  <tr>
+    <td valign="top">ignoreRemoved</td>
+    <td valign="top">When set to true, the report will not include any
+      removed files.  <em>Since Ant 1.8.0</em></td>
+    <td align="center" valign="top">No, defaults to false.</td>
 </table>
 
 <h3>Parameters inherited from the <code>cvs</code> task</h3>

Modified: 
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/cvslib/CvsTagDiff.java
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/cvslib/CvsTagDiff.java?rev=705241&r1=705240&r2=705241&view=diff
==============================================================================
--- 
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/cvslib/CvsTagDiff.java 
(original)
+++ 
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/cvslib/CvsTagDiff.java 
Thu Oct 16 06:42:30 2008
@@ -137,6 +137,11 @@
     private File mydestfile;
 
     /**
+     * Used to skip over removed files 
+     */
+    private boolean ignoreRemoved = false;
+
+    /**
      * The package/module to analyze.
      * @param p the name of the package to analyse
      */
@@ -190,6 +195,18 @@
     }
 
     /**
+     * Set the ignore removed indicator.
+     *
+     * @param b the ignore removed indicator.
+     *
+     * @since Ant 1.8.0
+     */ 
+    public void setIgnoreRemoved(boolean b) {
+        ignoreRemoved = b;
+    }
+
+
+    /**
      * Execute task.
      *
      * @exception BuildException if an error occurs
@@ -353,6 +370,9 @@
     }
 
     private boolean doFileWasRemoved(Vector entries, String line) {
+        if (ignoreRemoved) {
+            return false;
+        }
         int index = line.indexOf(FILE_WAS_REMOVED);
         if (index == -1) {
             return false;


Reply via email to