#19 p4change, changelists and perforce

open
nobody
None
9
2005-07-28
2005-04-19
RadeBlade
No

I'm having the same problem and I'm not sure what to
do. I've been tearing my hair out on getting perforce to
work with nantcontrib so that the build process can be
automated. Has anyone had any success doing this?
Please post any solutions/suggestions.

Discussion

  • RadeBlade
    RadeBlade
    2005-04-19

    Logged In: YES
    user_id=1261907

    I'm having the same problem as posted here:

    https://sourceforge.net/tracker/?
    func=detail&atid=474852&aid=961275&group_id=54790

    When you execute p4change, a window pops up, asking you
    what to do. This obviously is a problem for automated builds.
    Any help would be greatly appreciated.

     
  • Gert Driesen
    Gert Driesen
    2005-04-19

    Logged In: YES
    user_id=707851

    I don't have any perforce system that I can use to test the
    tasks, so I'm afraid you'll need to dig a little deeper yourself.

    Can you run your build in verbose mode, and execute the
    same commands from the command prompt ?

     
  • RadeBlade
    RadeBlade
    2005-07-28

    • priority: 5 --> 9
     
  • kudaba
    kudaba
    2005-12-01

    Logged In: YES
    user_id=1359697

    Quick FIX:

    The problem is that the task that runs the p4change
    command has to determing what change number to use. To do
    this it first creates a changelist and then tries to
    create it a second time which opens the window. I managed
    to fix this by overriding the task execution behavior and
    stopping the second call. Simply add this method to the
    P4Change class:

    protected override void ExecuteTask()
    {
    if ( Delete )
    {
    base.ExecuteTask();
    }
    else
    {
    if ( Changelist == null)
    {
    throw new
    BuildException("A \"changelist\" is required for p4edit");
    }

    Perforce.GetChangelistNumber( User, Client,
    Changelist, true );
    }
    }

     
  • veziak
    veziak
    2006-01-25

    Logged In: YES
    user_id=1435171

    hi, we have encountered the same problem, and fixed it by
    using ant tasks :), we wrote a nant task that can
    transparently run any ant task. if anybody interested in it,
    we can share it (where are a lot of other useful tasks, u
    can't find in nant, such as ftp, sync etc)

    example of running ant p4change and ftp task from nant:

    <target name="runAntTask">
    <property name="chList" value="nant_chlist" />
    <property name="p4User" value="builder" />
    <property name="p4Client" value="vss_work" />
    <property name="p4Host" value="10.8.60.125:1666" />
    <property name="p4Root" value="" />
    <property name="view"
    value="//vss/ftp/Genesis/g_2.4.0.0/..." />

    <runAnt antPath="${antPath}" DeleteTempFiles="false"
    verbose="true">
    <p4change description="ant Genesis sync ftp"/>
    <p4edit view="${view}" change="${p4.change}" />

    <ftp
    server="${ftp}"
    userid="${ftpUser}"
    password="${ftpPassword}"
    action="list"
    passive="yes"
    listing="list.txt"
    depends="yes"
    verbose="yes">
    <fileset dir="${localDir}">
    </fileset>
    </ftp>

    <p4submit change="${p4.change}"/>

    <ftp
    server="${ftp}"
    userid="${ftpUser}"
    password="${ftpPassword}"

    timediffauto="true"
    depends="yes"
    verbose="yes" >
    <fileset dir="${localDir}">
    <include name="**"/>
    </fileset>
    </ftp>
    </runAnt>
    </target>