views:

1057

answers:

5

I've downloaded the svntask for ant from tigris.org, so it is the "official" one.

I have a simple task to update my entire project

<target name="prepare">
    <svn username="user" password="pass">
  <update>    
   <fileset dir="."/>
  </update>
 </svn>
</target>

Running this task took about 2 hours.

Running a svn update on the command line took about 5 seconds.

(in both cases, there were no updates to bring down from the server)

I've also tried chaning the method that svntask uses to interface with subversion, I've tried both the svnkit method and the command line method.

Any ideas why this may be taking so long? Obviously this is unacceptably slow.

Thanks

A: 

So if you just run "ant prepare" it takes 2 hrs? Or is this 2 hr duration only under special conditions like your build machine?

Have you tried using the task for comparison, to try and isolate if it is Ant vs. the particular task?

Jeffrey Fredrick
+1  A: 

1.Which lib are you using for accessing to svn (svnkit or javahl)?

Try to explicitly provide an appropriate library:

<svn username="user" password="pass" svnkit="true">

2.I'm not sure if you have to provide username and password params for an update (their were cached on checkout).

3.If your use case are similar to mine, you can reuse checkout task for both checkout and an update:

<target name="prepare">
  <svn username="user" password="pass">
      <checkout url="${svn.url}" destpath="${svn.path}" />
    </svn>
</target>
FoxyBOA
A: 

I can't see why it would take 2 hours for the svntask, so I would first look into this in more details.

But if you must, you could run SVN from the command line:

<exec executable="cmd.exe">
    <arg line="/c svn checkout repository ..."/>
</exec>

Edit: Actually, you don't need the dos window, you can do it directly. I just do this so I can see the output in the ant console.

Stephane Grenier
+6  A: 

By using the nested <fileset> the command ends up calling update for every file in the current directory hierarchy. That's probably why it takes two hours.

Try using the dir attribute of the update task:

    <svn username="user" password="pass">
        <update dir="."/>                                
    </svn>

And, if that doesn't work, turn on -verbose or -debug and see if you can get more information about what is happening during the task.

Ken Gentle
A: 

It might be instructive to profile your build to see where it's actually spending most of its time. antutility is very easy to use for this purpose. Just add the jar to your classpath and run it like:

  ant -listener net.java.antutility.BuildMetricsListener [target]
Limbic System