Browse Source

Provide control over EOL conversion via a new attribute.

PR: 18884
Submitted by:	Steve Cohen <scohen at apache dot org>
                Aaron DeForest <aaron underscore deforest at rosettabio dot com>


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@274541 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 22 years ago
parent
commit
d3f2f2b687
3 changed files with 42 additions and 4 deletions
  1. +4
    -0
      WHATSNEW
  2. +10
    -0
      docs/manual/OptionalTasks/starteam.html
  3. +28
    -4
      src/main/org/apache/tools/ant/taskdefs/optional/starteam/StarTeamCheckout.java

+ 4
- 0
WHATSNEW View File

@@ -279,6 +279,10 @@ Other changes:
* <unzip> will now detect and successfully extract self-extracting
archives. Bugzilla Report 16213.

* <stcheckout> has a new attribute "converteol" that can be used to
control the automatic line-end conversion performed on ASCII files.
Bugzilla Report 18884.

Changes from Ant 1.5.2 to Ant 1.5.3
===================================



+ 10
- 0
docs/manual/OptionalTasks/starteam.html View File

@@ -176,6 +176,16 @@ of checkout.</td> <td align="center" valign="top">no</td>
<td align="center" valign="top">yes</td>
</tr>
<tr>
<td valign="top">convertEOL</td>
<td valign="top">If true, (default) all ascii files will have their end-of-line
characters adjusted to that of the local machine on checkout. This is normally
what you'd want but if for some reason you don't want that to happen, set it to false
and the files will be checked out with whatever end-of-line characters are used on
the server. </td>
<td align="center" valign="top">yes</td>
</tr>

</table>

<h3>Examples</h3>


+ 28
- 4
src/main/org/apache/tools/ant/taskdefs/optional/starteam/StarTeamCheckout.java View File

@@ -98,6 +98,14 @@ public class StarTeamCheckout extends TreeBasedTask {
*/
private boolean deleteUncontrolled = true;

/**
* holder for the deleteUncontrolled attribute. If true,
* (default) local non-binary files will be checked out using the local
* platform's EOL convention. If false, checkouts will preserve the
* server's EOL convention.
*/
private boolean convertEOL = true;

/**
* flag (defaults to true) to create all directories
* that are in the Starteam repository even if they are empty.
@@ -117,6 +125,16 @@ public class StarTeamCheckout extends TreeBasedTask {
this.deleteUncontrolled = value;
}

/**
* Set whether or not files should be checked out using the
* local machine's EOL convention.
* Optional, defaults to <code>true</code>.
* @param value the value to set the attribute to.
*/
public void setConvertEOL(boolean value) {
this.convertEOL = value;
}
/**
* Sets the label StarTeam is to use for checkout; defaults to the most recent file.
* The label must exist in starteam or an exception will be thrown.
@@ -277,7 +295,8 @@ public class StarTeamCheckout extends TreeBasedTask {
log(" Items will be checked out with Exclusive locks.");
}
else if (this.lockStatus == Item.LockType.UNLOCKED) {
log(" Items will be checked out unlocked (even if presently locked).");
log(" Items will be checked out unlocked "
+"(even if presently locked).");
}
else {
log(" Items will be checked out with no change in lock status.");
@@ -291,9 +310,14 @@ public class StarTeamCheckout extends TreeBasedTask {
if (this.deleteUncontrolled) {
log(" Local items not found in the repository will be deleted.");
}
log(" Items will be checked out " +
(this.convertEOL
? "using the local machine's EOL convention"
: "without changing the EOL convention used on the server"));
log(" Directories will be created"+
(this.createDirs ? " wherever they exist in the repository, even if empty."
: " only where needed to check out files."));
(this.createDirs
? " wherever they exist in the repository, even if empty."
: " only where needed to check out files."));
}
/**
@@ -520,7 +544,7 @@ public class StarTeamCheckout extends TreeBasedTask {
}
}
eachFile.checkout(this.lockStatus,
!this.useRepositoryTimeStamp, true, true);
!this.useRepositoryTimeStamp, this.convertEOL, true);
}
}
}


Loading…
Cancel
Save