List Info

Thread: updating current directory from ant svn task on Windows




updating current directory from ant svn task on Windows
user name
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=&quot;1.0&quot;?>

<project name=";test" basedir=&quot;." default=&quot;update&quot;>

 <;!-- setup for the svn task -->
&nbsp;<taskdef resource=&quot;svntask.properties" classpath="/c/tsunami/ant/apache-ant-1.7.0/dist/lib/svnant.jar"/&gt;

 ; &nbsp; &nbsp; &nbsp; <target name=";update&quot; description="run SVN update&quot;>
&nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp;  <svn javahl=&quot;false&quot;>
&nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; <update dir="." recurse=&quot;false&quot; />
&nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;  </svn&gt;
 &nbsp; &nbsp;   ; </target>

&lt;/project&gt;

If I run ant -f build.xml in that directory, I get:

Resulting Output:

$ ant -f build.xml
Buildfile: build.xml

update:
  ; &nbsp;  [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
user name
2007-03-22 15:05:36
On 3/22/07, Eduard Kotysh < nutellaboigmail.com">nutellaboigmail.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=&quot;1.0&quot;?>

<project name=";test" basedir=&quot;." default=&quot;update&quot;>

 <;!-- setup for the svn task -->
&nbsp;<taskdef resource=&quot;svntask.properties" classpath="/c/tsunami/ant/apache-ant-1.7.0/dist/lib/svnant.jar"/&gt;

 ; &nbsp; &nbsp; &nbsp; <target name=";update&quot; description="run SVN update&quot;>
&nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp;  <svn javahl=&quot;false&quot;>
&nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; <update dir="." recurse=&quot;false&quot; />
&nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;  </svn&gt;
 &nbsp; &nbsp;   ; </target>

&lt;/project&gt;

If I run ant -f build.xml in that directory, I get:

Resulting Output:

$ ant -f build.xml
Buildfile: build.xml

update:
  ; &nbsp;  [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.&nbsp; All of that output would be stuff emitted from svn.exe.&nbsp; 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.&nbsp; 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
user name
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:
&nbsp;
&nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;  <exec executable="svn&quot;>
&nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp; <arg line=";up -r HEAD c:tsunamisvnedbuild --non-interactive&quot;/>
&nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp;  </exec&gt;
&nbsp;
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.
&nbsp;
Do you think I should bring this up at Ant's mailing list?
&nbsp;
Thanks,
&nbsp;
Eduard Kotysh

&nbsp;
On 3/22/07, Mark Phippard < markphipgmail.com">markphipgmail.com> wrote:
On 3/22/07, Eduard Kotysh <gmail.com" target="_blank">nutellaboigmail.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=&quot;1.0&quot;?>

<project name=";test" basedir=&quot;." default=&quot;update&quot;>

 <;!-- setup for the svn task -->
&nbsp;<taskdef resource=&quot;svntask.properties" classpath="/c/tsunami/ant/apache-ant-1.7.0/dist/lib/svnant.jar"/&gt;

 ; &nbsp; &nbsp; &nbsp; <target name=";update&quot; description="run SVN update&quot;>
&nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp;  <svn javahl=&quot;false&quot;>
&nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; <update dir="." recurse=&quot;false&quot; />
 &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   </svn&gt;
 &nbsp; &nbsp;   ; </target>

&lt;/project&gt;

If I run ant -f build.xml in that directory, I get:

Resulting Output:

$ ant -f build.xml
Buildfile: build.xml

update:
  ; &nbsp;  [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.&nbsp; All of that output would be stuff emitted from svn.exe.&nbsp; 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.&nbsp; 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
user name
2007-03-22 15:33:10
On 3/22/07, Eduard Kotysh < nutellaboigmail.com">nutellaboigmail.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:
&nbsp;
&nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;  <exec executable="svn&quot;>
&nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp; <arg line=";up -r HEAD c:tsunamisvnedbuild --non-interactive&quot;/>
&nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp;  </exec&gt;
&nbsp;
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.
&nbsp;
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.&nbsp; 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
user name
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 < markphipgmail.com">markphipgmail.com> wrote:
On 3/22/07, Eduard Kotysh <gmail.com" target="_blank"> nutellaboigmail.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:
&nbsp;
&nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;  <exec executable="svn&quot;>
&nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp; <arg line=";up -r HEAD c:tsunamisvnedbuild --non-interactive&quot;/>
&nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp;  </exec&gt;
&nbsp;
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.
&nbsp;
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.&nbsp; 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.

&nbsp;

--
Thanks

Mark Phippard
http://markphip.blogspot.com/

Re: updating current directory from ant svn task on Windows
user name
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 . &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   ;  OK
svn up -r HEAD C:tsunamisvnbuild&nbsp; &nbsp;  FAILS
&nbsp;
so if I give a fully qualified path, ;something behaves differently than if I give the current directory!
 
From cygwin however, both work:
&nbsp;
svn up -r HEAD . &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   ;  OK
svn up -r HEAD C:tsunamisvnbuild&nbsp; &nbsp;  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:
 
&nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   ; <svn javahl=&quot;false&quot;>
&nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; <update dir="." recurse=&quot;false&quot; />
 &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; </svn&gt;
 ;
Well, if I execute it as plain executable and pass it . instead of fully qualified path, it works:
 
&nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   ; <exec executable="svn&quot;>
&nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp; <arg line=";up -r HEAD .  --non-interactive&quot;/>
&nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp;  </exec&gt;
&nbsp;
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 < nutellaboigmail.com">nutellaboigmail.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">markphipgmail.com > wrote:
On 3/22/07, Eduard Kotysh <gmail.com" target="_blank"> nutellaboigmail.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:
&nbsp;
&nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;  <exec executable="svn&quot;>
&nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp; <arg line=";up -r HEAD c:tsunamisvnedbuild --non-interactive&quot;/>
&nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp;  </exec&gt;
&nbsp;
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.
&nbsp;
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.&nbsp; 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
user name
2007-03-23 14:40:07
On 3/23/07, Eduard Kotysh < nutellaboigmail.com">nutellaboigmail.com> wrote:
 
In DOS command prompt, from C:tsunamisvnbuild directory:
 
svn up -r HEAD . &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   ;  OK
svn up -r HEAD C:tsunamisvnbuild&nbsp; &nbsp;  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
user name
2007-03-23 14:53:57
Thanks Mark

On 3/23/07, Mark Phippard < markphipgmail.com">markphipgmail.com> wrote:
On 3/23/07, Eduard Kotysh <gmail.com" target="_blank"> nutellaboigmail.com> wrote:
 
In DOS command prompt, from C:tsunamisvnbuild directory:
 
svn up -r HEAD . &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   ;  OK
svn up -r HEAD C:tsunamisvnbuild&nbsp; &nbsp;  FAILS

I would focus on this part and try reporting it to Subversion users list.

&nbsp;

--
Thanks

Mark Phippard
http://markphip.blogspot.com/

Re: updating current directory from ant svn task on Windows
user name
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.
&nbsp;
Ed

 
On 3/23/07, Eduard Kotysh < nutellaboigmail.com">nutellaboigmail.com> wrote:
Thanks Mark


On 3/23/07, Mark Phippard <gmail.com" target="_blank">markphipgmail.com > wrote:
On 3/23/07, Eduard Kotysh <gmail.com" target="_blank"> nutellaboigmail.com> wrote:
 
In DOS command prompt, from C:tsunamisvnbuild directory:
 
svn up -r HEAD . &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   ;  OK
svn up -r HEAD C:tsunamisvnbuild&nbsp; &nbsp;  FAILS

I would focus on this part and try reporting it to Subversion users list.

&nbsp;

--
Thanks

Mark Phippard
http://markphip.blogspot.com/


[1-9]

about | contact  Other archives ( Real Estate discussion Medical topics )