[p4] Tag and Label via cmd line with description

Tony Sweeney sweeney at addr.com
Tue Oct 21 12:55:22 PDT 2008


peter mcgrath wrote:
> Hi
>
> I have an ANT script where I'm trying to create a label and I'm using that
> label to Tag a Project, I want to have the description\comment for the label
> go in with the tag, which presently I have not found any info on. When I
> execute the command  <arg line="p4 label -i ${label} //depot/test/..."/> I
> get the error:
> [exec] Usage: label [ -d -f -i -o -t template ] labelname
>      [exec] Missing/wrong number of arguments.
>      [exec] Result: 1
>
> So if anyone knows how I can create a label without the above error would be
> great, but that aside I need to know how to add the description to a TAG as
> the code is tagged but there is no description only who created the tag. Any
> and all help and hints are welcome.
>
> <target name="test-label">
>
>    <echo>Label: P4: labelling tree //depot/test/... ${label}</echo>
>   <exec executable="cmd">
>        <arg value="/c"/>
>         <arg line="p4 label -i ${label} //depot/test/..."/>
>      </exec>
>   
'p4 label -i' expects to read the label spec from stdin.  The quickest 
way to generate a valid label spec is with 'p4 label -o labelname'.  Try 
it to see the format.  That won't actually create the a label called 
'labelname' if it doesn't already exist, it just prints out  a valid 
spec.  Pipe the output to 'p4 label -i', however, and your label will be 
created.  You can use '-t template' as an additional argument to 'p4 
label -o' if you want the view restricted to some subset of your depot 
as specified in an existing label.

>   <exec executable="cmd">
>        <arg value="/c"/>
>         <arg line="p4 tag -l ${label} //depot/test/..."/>
>      </exec>
>  </target>
>   
This part should be fine.

Tony.
> _______________________________________________
> perforce-user mailing list  -  perforce-user at perforce.com
> http://maillist.perforce.com/mailman/listinfo/perforce-user
>
>
>   



More information about the perforce-user mailing list