You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by bu...@apache.org on 2002/05/09 04:41:48 UTC

DO NOT REPLY [Bug 8929] New: - p4sync force="false", "no", etc.. still forces

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=8929>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=8929

p4sync force="false", "no", etc..  still forces

           Summary: p4sync force="false", "no", etc..  still forces
           Product: Ant
           Version: 1.5Beta1
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Optional Tasks
        AssignedTo: ant-dev@jakarta.apache.org
        ReportedBy: carnold@houston.rr.com


Any non-empty value, "false", "no", etc for force attribute will cause the 
task to forcibly sync.  The documentation doesn't give any hint of this, it 
only shows using force="yes".

Changing the attribute type from String to boolean should do the trick, though 
it could possibly break some existing build scripts.  However, if it isn't 
fixed then you'd have to cover it with a lengthy explanation in the 
documentation.



Index: P4Sync.java
===================================================================
RCS file: /home/cvspublic/jakarta-
ant/src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Sync.java,v
retrieving revision 1.8
diff -u -r1.8 P4Sync.java
--- P4Sync.java	12 Apr 2002 13:44:36 -0000	1.8
+++ P4Sync.java	9 May 2002 02:25:20 -0000
@@ -94,11 +94,10 @@
     }
 
 
-    public void setForce(String force) throws BuildException {
-        if (force == null && !label.equals("")) {
-            throw new BuildException("P4Sync: If you want to force, set force 
to non-null string!");
+    public void setForce(boolean force) throws BuildException {
+        if (force) {
+            P4CmdOpts = "-f";
         }
-        P4CmdOpts = "-f";
     }
 
     public void execute() throws BuildException {

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>