You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by an...@apache.org on 2004/01/15 21:27:07 UTC

cvs commit: ant/docs/manual/OptionalTasks perforce.html

antoine     2004/01/15 12:27:07

  Modified:    .        WHATSNEW
               src/main/org/apache/tools/ant/taskdefs/optional/perforce
                        P4Submit.java
               docs/manual/OptionalTasks perforce.html
  Added:       src/etc/testcases/taskdefs/optional/perforce
                        changerenumbered.xml needsresolve.xml
  Removed:     src/testcases/org/apache/tools/ant/taskdefs/optional/perforce
                        build1.xml build2.xml
  Log:
  Add two new attributes in p4submit :
  needsresolveproperty and changeproperty
  PR: 25711
  
  Revision  Changes    Path
  1.1                  ant/src/etc/testcases/taskdefs/optional/perforce/changerenumbered.xml
  
  Index: changerenumbered.xml
  ===================================================================
  <!-- author Antoine Levy-Lambert  -->
  <!-- this file demonstrates that p4.change will be modified by p4submit -->
  <!-- if the change number is modified by the Perforce daemon during the submission -->
  <project name="build1" default="runtest">
    <target name="runtest">
      <p4change/>
      <property name="change1" value="${p4.change}" />
      <echo>
  doing a first change ${change1}
  </echo>
      <p4change/>
      <property name="change2" value="${p4.change}" />
      <echo>
  doing a second change ${change2}
  </echo>
      <p4edit view="//depot/foobar" change="${change1}" />
      <p4edit view="//depot/hello" change="${change2}" />
      <echo>
  before submitting of hello change ${change2} p4.change is now ${p4.change}
  </echo>
      <p4submit change="${change2}"/>
      <echo>
  after submitting of hello p4.change is now ${p4.change}
  </echo>
      <echo>
  before submitting of foobar change ${change1}
  </echo>
      <p4submit change="${change1}"/>
      <echo>
  after submitting of foobar p4.change is now ${p4.change}
  </echo>
    </target>
  </project>
  
  
  
  1.1                  ant/src/etc/testcases/taskdefs/optional/perforce/needsresolve.xml
  
  Index: needsresolve.xml
  ===================================================================
  <!-- author Antoine Levy-Lambert -->
  <!-- this test shows that p4 submit can now indicate that a file needs to be resolved -->
  <!-- before running the test, edit this xml and change the 5 properties at the top to values which make sense on your system-->
  <!-- the test uses two Perforce client specs which must exist beforehand -->
  <!-- also using both client specs you should be able to edit the file ${depot_file_spec} -->
  <project name="testresolve" default= "test">
    <property name="first_client" value="levyant_dev_ant"/>
    <property name="first_client_root" value="C:\dev\depot"/>
    <property name="second_client" value="levyant_cygwin_test"/>
    <property name="second_client_root" value="C:\dev\test"/>
    <property name="depot_file_spec" value="//depot/foobar"/>
    <target name="test">
      <p4change client="${first_client}"/>
      <property name="change1" value="${p4.change}" />
      <p4change client="${second_client}"/>
      <property name="change2" value="${p4.change}" />
      <sequential>
        <antcall target="edit">
  	<param name="p4.client" value="${first_client}"/>
  	<param name="client_root" value="${first_client_root}"/>
  	<param name="change" value="${change1}"/>
        </antcall>
        <antcall target="edit">
  	<param name="p4.client" value="${second_client}"/>
  	<param name="client_root" value="${second_client_root}"/>
  	<param name="change" value="${change2}"/>
        </antcall>
        <antcall target="submit">
  	<param name="p4.client" value="${first_client}"/>
  	<param name="change" value="${change1}"/>
        </antcall>
        <antcall target="submit">
  	<param name="p4.client" value="${second_client}"/>
  	<param name="change" value="${change2}"/>
        </antcall>
      </sequential>
    </target>
    <target name="edit">
      <echo>
  doing a  change ${change} on  client ${p4.client}
  </echo>
      <p4edit change="${change}" view="${depot_file_spec}"/>
      <mkdir dir="${client_root}/depot"/>
      <echo file="${client_root}/depot/foobar">
  hello ${p4.client} ${change}
  </echo>
    </target>
    <target name="submit">
      <p4submit change="${change}" needsresolveproperty="needsresolve" changeproperty="mychange"/>
      <echo>
  p4.needsresolve ${p4.needsresolve} after submit
          needsresolveproperty ${needsresolve} after submit
          changeproperty ${mychange} after submit
  </echo>
    </target>
  </project>
  
  
  1.525     +3 -0      ant/WHATSNEW
  
  Index: WHATSNEW
  ===================================================================
  RCS file: /home/cvs/ant/WHATSNEW,v
  retrieving revision 1.524
  retrieving revision 1.525
  diff -u -r1.524 -r1.525
  --- WHATSNEW	15 Jan 2004 08:43:04 -0000	1.524
  +++ WHATSNEW	15 Jan 2004 20:27:07 -0000	1.525
  @@ -38,6 +38,9 @@
   
   * <fixcrlf> has a new attribute - fixlast. Bugzilla Report 23262.
   
  +* <p4submit> has 2 new attributes, needsresolveproperty and changeproperty.
  +  Bugzilla Report 25711.
  +
   Changes from Ant 1.5.4 to Ant 1.6.0
   ===================================
   
  
  
  
  1.18      +32 -2     ant/src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Submit.java
  
  Index: P4Submit.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Submit.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- P4Submit.java	25 Sep 2003 20:47:17 -0000	1.17
  +++ P4Submit.java	15 Jan 2004 20:27:07 -0000	1.18
  @@ -1,7 +1,7 @@
   /*
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
  + * Copyright (c) 2000-2004 The Apache Software Foundation.  All rights
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  @@ -83,7 +83,14 @@
        * change list number
        */
       public String change;
  -
  +    /**
  +     * change property
  +     */
  +    private String changeProperty;
  +    /**
  +     * needsresolveproperty
  +     */
  +    private String needsResolveProperty;
       /**
        * set the change list number to submit
        * @param change The changelist number to submit; required.
  @@ -91,6 +98,23 @@
       public void setChange(String change) {
           this.change = change;
       }
  +    /**
  +     * property defining the change number if the change number gets renumbered
  +     * @param changeProperty name of a new property to which the change number
  +     * will be assigned if it changes
  +     * @since ant 1.6.1
  +     */
  +    public void setChangeProperty(String changeProperty) {
  +        this.changeProperty = changeProperty;
  +    }
  +    /**
  +     * property defining the need to resolve the change list
  +     * @param needsResolveProperty a property which will be set if the change needs resolve
  +     * @since ant 1.6.1
  +     */
  +    public void setNeedsResolveProperty(String needsResolveProperty) {
  +        this.needsResolveProperty = needsResolveProperty;
  +    }
   
       /**
        * do the work
  @@ -133,6 +157,9 @@
                               int changenumber = Integer.parseInt(chnum);
                               log("Perforce change renamed " + changenumber, Project.MSG_INFO);
                               getProject().setProperty("p4.change", "" + changenumber);
  +                            if (changeProperty != null) {
  +                                getProject().setNewProperty(changeProperty, chnum);
  +                            }
                               found = false;
                           }
                           if (((myarray.elementAt(counter))).equals("renamed")) {
  @@ -148,6 +175,9 @@
               }
               if (util.match("/p4 submit -c/", line)) {
                   getProject().setProperty("p4.needsresolve", "1");
  +                if (needsResolveProperty != null) {
  +                    getProject().setNewProperty(needsResolveProperty, "true");
  +                }
               }
   
           }
  
  
  
  1.24      +22 -3     ant/docs/manual/OptionalTasks/perforce.html
  
  Index: perforce.html
  ===================================================================
  RCS file: /home/cvs/ant/docs/manual/OptionalTasks/perforce.html,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- perforce.html	25 Sep 2003 20:36:55 -0000	1.23
  +++ perforce.html	15 Jan 2004 20:27:07 -0000	1.24
  @@ -9,9 +9,8 @@
       <li>Les Hughes (<a href="mailto:leslie.hughes@rubus.com">leslie.hughes@rubus.com</a>)</li>
       <li>Kirk Wylie (<a href="mailto:kirk@radik.com">kirk@radik.com</a>)</li>
       <li>Matt Bishop (<a href="mailto:matt@thebishops.org">matt@thebishops.org</a>)</li>
  -    <li>Antoine Levy-Lambert (<a href="mailto:levylambert@tiscali-dsl.de">levylambert@tiscali-dsl.de</a>)</li>
  +    <li>Antoine Levy-Lambert</li>
   </ul>
  -<p>Version $Revision$ - $Date$</p>
   <hr>
   <h2>Contents</h2>
   <ul>
  @@ -330,6 +329,20 @@
       <td valign="top">The changelist number to submit</td>
       <td valign="top" align="center">Yes</td>
     </tr>
  +  <tr>
  +    <td valign="top">changeproperty</td>
  +    <td valign="top">Name of a property to which the new change number
  +    will be assigned if the Perforce server renumbers the change<br>
  +    Since ant 1.6.1</td>
  +    <td valign="top" align="center">No</td>
  +  </tr>
  +  <tr>
  +    <td valign="top">needsresolveproperty</td>
  +    <td valign="top">Name of property which will be set to <code>true</code>
  +    if the submit requires a resolve<br>
  +    Since ant 1.6.1</td>
  +    <td valign="top" align="center">No</td>
  +  </tr>
   </table>
   
   <h3>Examples</h3>
  @@ -959,9 +972,15 @@
                        Changed p4submit (detection of changes of change numbers,
                        and of failed submits due to resolution needed)</td>
   </tr>
  +<tr>
  +    <td valign="top">Jan 2004</td>
  +    <td valign="top">ant 1.6.1</td>
  +    <td valign="top">
  +Changed p4submit, needsresolveproperty and changeproperty added</td>
  +</tr>
   </table>
   <hr>
  -<p align="center">Copyright &copy; 2001-2003 Apache Software Foundation. All rights
  +<p align="center">Copyright &copy; 2001-2004 Apache Software Foundation. All rights
   Reserved.</p>
   </body>
   </html>
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org