<!-- 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>