|
List Info
Thread: updating current directory from ant svn task on Windows
|
|
| updating current directory from ant svn
task on Windows |

|
2007-03-22 14:51:03 |
|
I believe I ran into a bug today. I wrote an ant svn task that simply updates the current directory.
Here is the code inside my build.xml:
<?xml version="1.0"?>
<project name="test" basedir="." default="update">
<!-- setup for the svn task --> <taskdef resource="svntask.properties" classpath="/c/tsunami/ant/apache-ant-1.7.0/dist/lib/svnant.jar"/>
<target name="update" description="run SVN update"> <svn javahl="false"> <update dir="." recurse="false" />
</svn> </target>
</project>
If I run ant -f build.xml in that directory, I get:
Resulting Output:
$ ant -f build.xml Buildfile: build.xml
update: [svn] Using command line interface Svn : Updating up -r HEAD c:tsunamisvnedbuild --non-interactive svn: Working copy 'c:tsunamisvnedbuild' locked svn: run 'svn cleanup9; to remove locks (type 'svn help cleanup9; for details)
BUILD FAILED c:tsunamisvnedbuildbuild.xml:9: Cannot update dir c:tsunamisvnedbuild
Total time: 0 seconds
If I do svn stat, I don't see any outstanding locks, and svn cleanup doesn't do anything.
If I go up a directory and run ant -f build/build.xml it works every time.
I'm not sure what's going on, but sure looks like a bug and I don't like the workaround of going up a directory and running it from there.
This error has been noted by another user last year, here is the post (although he suspected the whitespace in the path were causing the issue, but that's clearly not the case here because my path is just c:tsunamisvnedbuild):
http://svn.haxx.se/subusers/archive-2006-10/0195.shtml
Note: this is only problem on Windows running under either cygwin or plain command line
Any help or ideas guys? Thank you
Eduard
|
| Re: updating current directory from ant
svn task on Windows |

|
2007-03-22 15:05:36 |
|
On 3/22/07, Eduard Kotysh < nutellaboi gmail.com">nutellaboi gmail.com> wrote:
I believe I ran into a bug today. I wrote an ant svn task that simply updates the current directory.
Here is the code inside my build.xml:
<?xml version="1.0"?>
<project name="test" basedir="." default="update">
<!-- setup for the svn task --> <taskdef resource="svntask.properties" classpath="/c/tsunami/ant/apache-ant-1.7.0/dist/lib/svnant.jar"/>
<target name="update" description="run SVN update"> <svn javahl="false"> <update dir="." recurse="false" />
</svn> </target>
</project>
If I run ant -f build.xml in that directory, I get:
Resulting Output:
$ ant -f build.xml Buildfile: build.xml
update: [svn] Using command line interface Svn : Updating up -r HEAD c:tsunamisvnedbuild --non-interactive svn: Working copy 'c:tsunamisvnedbuild' locked svn: run 'svn cleanup9; to remove locks (type 'svn help cleanup9; for details)
BUILD FAILED c:tsunamisvnedbuildbuild.xml:9: Cannot update dir c:tsunamisvnedbuild
Total time: 0 seconds
If I do svn stat, I don't see any outstanding locks, and svn cleanup doesn't do anything.
If I go up a directory and run ant -f build/build.xml it works every time.
I'm not sure what's going on, but sure looks like a bug and I don't like the workaround of going up a directory and running it from there.
This error has been noted by another user last year, here is the post (although he suspected the whitespace in the path were causing the issue, but that's clearly not the case here because my path is just c:tsunamisvnedbuild):
http://svn.haxx.se/subusers/archive-2006-10/0195.shtml
Note: this is only problem on Windows running under either cygwin or plain command line
Any help or ideas guys? Thank you It would just be using your command line svn.exe and running the command shown. All of that output would be stuff emitted from svn.exe. I would think you could recreate the problem by opening a command window and running the same command.
svn up -r HEAD c:tsunamisvnedbuild --non-interactive
Your goal should be to recreate it using just the plain old command line because then you could report it on the Subversion users list and possibly get a better explanation or even get someone to agree it is a bug.
One thing that does look odd is that you said recurse false, so the command should also have the -N option. That being said the command logged in the output is not the actual command line, just a marker we add so you know what is being done. It is possible, there is just a bug in the output and the -N is passed to the command line. Still, even if it was not passed, you would expect the command to recurse, not fail. So try to recreate.
-- Thanks
Mark Phippard http://markphip.blogspot.com/
|
| Re: updating current directory from ant
svn task on Windows |

|
2007-03-22 15:31:28 |
|
Mark, thanks for reply. I tried running: svn up -r HEAD c:tsunamisvnedbuild --non-interactive by hand and it succeeded no problem.
I also tried running it under ant as an executable like this:
<exec executable="svn"> <arg line="up -r HEAD c:tsunamisvnedbuild --non-interactive"/> </exec>
And that gave an error (same error as before, Working copy locked) which makes me conclude this is an Ant bug because error happens only when run under Ant environment.
You also did point out an interesting thing about -N, indeed it doesn't show up even during successful run.
Do you think I should bring this up at Ant's mailing list?
Thanks,
Eduard Kotysh
On 3/22/07, Mark Phippard < markphip gmail.com">markphip gmail.com> wrote:
I believe I ran into a bug today. I wrote an ant svn task that simply updates the current directory.
Here is the code inside my build.xml:
<?xml version="1.0"?>
<project name="test" basedir="." default="update">
<!-- setup for the svn task --> <taskdef resource="svntask.properties" classpath="/c/tsunami/ant/apache-ant-1.7.0/dist/lib/svnant.jar"/>
<target name="update" description="run SVN update"> <svn javahl="false"> <update dir="." recurse="false" />
</svn> </target>
</project>
If I run ant -f build.xml in that directory, I get:
Resulting Output:
$ ant -f build.xml Buildfile: build.xml
update: [svn] Using command line interface Svn : Updating up -r HEAD c:tsunamisvnedbuild --non-interactive svn: Working copy 'c:tsunamisvnedbuild' locked svn: run 'svn cleanup9; to remove locks (type 'svn help cleanup9; for details)
BUILD FAILED c:tsunamisvnedbuildbuild.xml:9: Cannot update dir c:tsunamisvnedbuild
Total time: 0 seconds
If I do svn stat, I don't see any outstanding locks, and svn cleanup doesn't do anything.
If I go up a directory and run ant -f build/build.xml it works every time.
I'm not sure what's going on, but sure looks like a bug and I don't like the workaround of going up a directory and running it from there.
This error has been noted by another user last year, here is the post (although he suspected the whitespace in the path were causing the issue, but that's clearly not the case here because my path is just c:tsunamisvnedbuild):
http://svn.haxx.se/subusers/archive-2006-10/0195.shtml
Note: this is only problem on Windows running under either cygwin or plain command line
Any help or ideas guys? Thank you
It would just be using your command line svn.exe and running the command shown.&nbs p; All of that output would be stuff emitted from svn.exe. I would think you could recreate the problem by opening a command window and running the same command.
svn up -r HEAD c:tsunamisvnedbuild --non-interactive
Your goal should be to recreate it using just the plain old command line because then you could report it on the Subversion users list and possibly get a better explanation or even get someone to agree it is a bug.
One thing that does look odd is that you said recurse false, so the command should also have the -N option. That being said the command logged in the output is not the actual command line, just a marker we add so you know what is being done. It is possible, there is just a bug in the output and the -N is passed to the command line. Still, even if it was not passed, you would expect the command to recurse, not fail. So try to recreate.
-- Thanks
Mark Phippard http://markphip.blogspot.com/
|
| Re: updating current directory from ant
svn task on Windows |

|
2007-03-22 15:33:10 |
|
On 3/22/07, Eduard Kotysh < nutellaboi gmail.com">nutellaboi gmail.com> wrote:
Mark, thanks for reply. I tried running: svn up -r HEAD c:tsunamisvnedbuild --non-interactive by hand and it succeeded no problem.
I also tried running it under ant as an executable like this:
<exec executable="svn"> <arg line="up -r HEAD c:tsunamisvnedbuild --non-interactive"/> </exec>
And that gave an error (same error as before, Working copy locked) which makes me conclude this is an Ant bug because error happens only when run under Ant environment.
You also did point out an interesting thing about -N, indeed it doesn't show up even during successful run.
Do you think I should bring this up at Ant's mailing list? I wonder if the environment is different when the command is run via Java? I do not know how you could check that though. Maybe instead of running
svn.exe, run a .bat file that printed out all of the environment variables? Not that I know how to do that.
-- Thanks
Mark Phippard http://markphip.blogspot.com/
|
| Re: updating current directory from ant
svn task on Windows |

|
2007-03-22 16:10:26 |
|
That's a good idea, let me try that and I'll post the results.
Thanks
Ed
On 3/22/07, Mark Phippard < markphip gmail.com">markphip gmail.com> wrote:
On 3/22/07, Eduard Kotysh <gmail.com" target="_blank">
nutellaboi gmail.com> wrote:
Mark, thanks for reply. I tried running: svn up -r HEAD c:tsunamisvnedbuild --non-interactive by hand and it succeeded no problem.
I also tried running it under ant as an executable like this:
<exec executable="svn"> <arg line="up -r HEAD c:tsunamisvnedbuild --non-interactive"/> </exec>
And that gave an error (same error as before, Working copy locked) which makes me conclude this is an Ant bug because error happens only when run under Ant environment.
You also did point out an interesting thing about -N, indeed it doesn't show up even during successful run.
Do you think I should bring this up at Ant's mailing list?
I wonder if the environment is different when the command is run via Java? I do not know how you could check that though. Maybe instead of running svn.exe, run a .bat file that printed out all of the environment variables? Not that I know how to do that.
|
| Re: updating current directory from ant
svn task on Windows |

|
2007-03-23 14:37:33 |
|
Hey Mark,
I have compared the 4 major environment variables from Ant's point of view vs user environment: PATH, JAVA_HOME, ANT_HOME, CLASSPATH and didn't notice anything major except Ant is trying to be smart and antify the ANT_HOME depending on the platform by changing slashes.
I did several more experiments and here are some interesting results:
In DOS command prompt, from C:tsunamisvnbuild directory:
svn up -r HEAD . OK
svn up -r HEAD C:tsunamisvnbuild FAILS
so if I give a fully qualified path, something behaves differently than if I give the current directory!
From cygwin however, both work:
svn up -r HEAD . OK
svn up -r HEAD C:tsunamisvnbuild OK
I then thought that DOS cmd locks the directory and did a little test. I created a temp directory, cd'd into it, and then tried to delete it.
Both, DOS prompt and cygwin locked the directory and prevented me from deleting it, so that theory didn't stand...
Second set of experiments:
We know that when we execute svn ant task like this, it fails:
<svn javahl="false"> <update dir="." recurse="false" /> </svn>
Well, if I execute it as plain executable and pass it . instead of fully qualified path, it works:
<exec executable="svn"> <arg line="up -r HEAD . --non-interactive"/> </exec>
This result right there makes me think that svn ant task implementation is buggy.
Let me know what you think
Thanks
-Eduard
On 3/22/07, Eduard Kotysh < nutellaboi gmail.com">nutellaboi gmail.com> wrote:
That9;s a good idea, let me try that and I'll post the results.
Thanks
Ed
On 3/22/07, Mark Phippard <gmail.com" target="_blank">markphip gmail.com
> wrote:
On 3/22/07, Eduard Kotysh <gmail.com" target="_blank">
nutellaboi gmail.com> wrote:
Mark, thanks for reply. I tried running: svn up -r HEAD c:tsunamisvnedbuild --non-interactive by hand and it succeeded no problem.
I also tried running it under ant as an executable like this:
<exec executable="svn"> <arg line="up -r HEAD c:tsunamisvnedbuild --non-interactive"/> </exec>
And that gave an error (same error as before, Working copy locked) which makes me conclude this is an Ant bug because error happens only when run under Ant environment.
You also did point out an interesting thing about -N, indeed it doesn't show up even during successful run.
Do you think I should bring this up at Ant's mailing list?
I wonder if the environment is different when the command is run via Java? I do not know how you could check that though. Maybe instead of running svn.exe, run a .bat file that printed out all of the environment variables? Not that I know how to do that.
|
| Re: updating current directory from ant
svn task on Windows |

|
2007-03-23 14:40:07 |
|
On 3/23/07, Eduard Kotysh < nutellaboi gmail.com">nutellaboi gmail.com> wrote:
In DOS command prompt, from C:tsunamisvnbuild directory:
svn up -r HEAD . OK
svn up -r HEAD C:tsunamisvnbuild FAILS I would focus on this part and try reporting it to Subversion users list.
-- Thanks
Mark Phippard
http://markphip.blogspot.com/
|
| Re: updating current directory from ant
svn task on Windows |

|
2007-03-23 14:53:57 |
|
Thanks Mark
On 3/23/07, Mark Phippard < markphip gmail.com">markphip gmail.com> wrote:
On 3/23/07, Eduard Kotysh <gmail.com" target="_blank">
nutellaboi gmail.com> wrote:
In DOS command prompt, from C:tsunamisvnbuild directory:
svn up -r HEAD . OK
svn up -r HEAD C:tsunamisvnbuild FAILS
I would focus on this part and try reporting it to Subversion users list.
|
| Re: updating current directory from ant
svn task on Windows |

|
2007-03-23 15:40:29 |
|
Figured out the problem. I installed a win32 svn binary and prepended its bin to the PATH so it uses that svn executable instead of the one installed with cygwin.
Apparently, the 16bit cygwin svn was doing some funky stuff.
Everything is working now.
Ed
On 3/23/07, Eduard Kotysh < nutellaboi gmail.com">nutellaboi gmail.com> wrote:
Thanks Mark
On 3/23/07, Mark Phippard <gmail.com" target="_blank">markphip gmail.com
> wrote:
On 3/23/07, Eduard Kotysh <gmail.com" target="_blank">
nutellaboi gmail.com> wrote:
In DOS command prompt, from C:tsunamisvnbuild directory:
svn up -r HEAD . OK
svn up -r HEAD C:tsunamisvnbuild FAILS
I would focus on this part and try reporting it to Subversion users list.
|
[1-9]
|
|