Browse Source

allow cvstagdiff to ignore removed files. Submitted by Rob van Oostrum. PR 26257.

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@705241 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 17 years ago
parent
commit
ef94da3c23
3 changed files with 28 additions and 0 deletions
  1. +3
    -0
      WHATSNEW
  2. +5
    -0
      docs/manual/CoreTasks/cvstagdiff.html
  3. +20
    -0
      src/main/org/apache/tools/ant/taskdefs/cvslib/CvsTagDiff.java

+ 3
- 0
WHATSNEW View File

@@ -453,6 +453,9 @@ Other changes:


* <cvsversion> now works for local repositories as well. * <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 Changes from Ant 1.7.0 TO Ant 1.7.1
============================================= =============================================




+ 5
- 0
docs/manual/CoreTasks/cvstagdiff.html View File

@@ -69,6 +69,11 @@ operation may fail when using such an incompatible client.
<td valign="top">The file in which to write the diff report.</td> <td valign="top">The file in which to write the diff report.</td>
<td align="center" valign="top">Yes</td> <td align="center" valign="top">Yes</td>
</tr> </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> </table>


<h3>Parameters inherited from the <code>cvs</code> task</h3> <h3>Parameters inherited from the <code>cvs</code> task</h3>


+ 20
- 0
src/main/org/apache/tools/ant/taskdefs/cvslib/CvsTagDiff.java View File

@@ -136,6 +136,11 @@ public class CvsTagDiff extends AbstractCvsTask {
*/ */
private File mydestfile; private File mydestfile;


/**
* Used to skip over removed files
*/
private boolean ignoreRemoved = false;

/** /**
* The package/module to analyze. * The package/module to analyze.
* @param p the name of the package to analyse * @param p the name of the package to analyse
@@ -189,6 +194,18 @@ public class CvsTagDiff extends AbstractCvsTask {
mydestfile = f; mydestfile = f;
} }


/**
* 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. * Execute task.
* *
@@ -353,6 +370,9 @@ public class CvsTagDiff extends AbstractCvsTask {
} }


private boolean doFileWasRemoved(Vector entries, String line) { private boolean doFileWasRemoved(Vector entries, String line) {
if (ignoreRemoved) {
return false;
}
int index = line.indexOf(FILE_WAS_REMOVED); int index = line.indexOf(FILE_WAS_REMOVED);
if (index == -1) { if (index == -1) {
return false; return false;


Loading…
Cancel
Save