doInfo() throws exception: svn: 'C:\MyWork\Source\MyApp' is not a working copy

View: New views
2 Messages — Rating Filter:   Alert me  

doInfo() throws exception: svn: 'C:\MyWork\Source\MyApp' is not a working copy

by Robert La Ferla-6 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I am trying to use SVNKit under Grails to extract version info from SVN.

I almost have this working BUT there is an exception:

svn: 'C:\MyWork\Source\MyApp' is not a working copy

I am running this under Cygwin but the same problem occurs using the
Windows XP Pro cmd line.  If I run 'svn info' it works fine.  I using
svn 1.6.5 on Windows XP Pro.

Here's the output:

$ grails test war
Welcome to Grails 1.1.1 - http://grails.org/
Licensed under Apache Standard License 2.0
Grails home is set to: c:/MyStuff/Tools/grails-1.1.1

Base Directory: C:\MyWork\Source\MyApp
Running script c:\MyStuff\Tools\grails-1.1.1\scripts\War.groovy
Environment set to test
Warning, target causing name overwriting of name cleanAll
Warning, target causing name overwriting of name clean
Warning, target causing name overwriting of name cleanCompiledSources
Warning, target causing name overwriting of name cleanTestReports
Warning, target causing name overwriting of name cleanWarFile
Warning, target causing name overwriting of name startLogging
******************* eventWarStart *****************
clientManager = org.tmatesoft.svn.core.wc.SVNClientManager@2cd728
wcClient = org.tmatesoft.svn.core.wc.SVNWCClient@455aa8
baseFile = C:\MyWork\Source\MyApp
**************** SVN exception **************
svn: 'C:\MyWork\Source\MyApp' is not a working copy


Here's the code:

import org.tmatesoft.svn.core.wc.*;
import org.tmatesoft.svn.core.*;
import org.tmatesoft.svn.core.io.*;
import org.tmatesoft.svn.core.internal.io.dav.DAVRepositoryFactory;
import org.tmatesoft.svn.core.internal.io.fs.FSRepositoryFactory;
import org.tmatesoft.svn.core.internal.io.svn.SVNRepositoryFactoryImpl;

eventWarStart = { type ->
     println "******************* eventWarStart *****************"
   try {
       // initialise SVNKit
       DAVRepositoryFactory.setup();
       SVNRepositoryFactoryImpl.setup();
       FSRepositoryFactory.setup();
             SVNClientManager clientManager =
SVNClientManager.newInstance();
       println "clientManager = " + clientManager.toString();
       SVNWCClient wcClient = clientManager.getWCClient();
       println "wcClient = " + wcClient.toString();

       // the svnkit equivalent of "svn info"
       File baseFile = new File(basedir);

       println "baseFile = " + baseFile.toString();
       SVNInfo svninfo = wcClient.doInfo(baseFile, SVNRevision.WORKING);
       println "svninfo = " + svninfo.toString();

       def version = svninfo.getURL();
       println "Setting Version to: ${version}"
       metadata.'app.version' = "${version}".toString()
       metadata.persist()

   }
   catch (SVNException ex) {
       //something went wrong
       println "**************** SVN exception **************"
       println ex.getMessage();
   }
  } // End eventWarStart()

---------------------------------------------------------------------
To unsubscribe, e-mail: svnkit-users-unsubscribe@...
For additional commands, e-mail: svnkit-users-help@...


Re: doInfo() throws exception: svn: 'C:\MyWork\Source\MyApp' is not a working copy

by Dan HE :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I met similar problem before.
In my scenario, it's because I updated the svn client to 1.6.x.
but I did not update the svnkit.
I suggest you to update the svnkit to the latest version and try again.
 
Regards
-- Dan 

On Fri, Sep 25, 2009 at 5:58 AM, Robert La Ferla <robert.laferla@...> wrote:
I am trying to use SVNKit under Grails to extract version info from SVN.
I almost have this working BUT there is an exception:

svn: 'C:\MyWork\Source\MyApp' is not a working copy

I am running this under Cygwin but the same problem occurs using the Windows XP Pro cmd line.  If I run 'svn info' it works fine.  I using svn 1.6.5 on Windows XP Pro.

Here's the output:

$ grails test war
Welcome to Grails 1.1.1 - http://grails.org/
Licensed under Apache Standard License 2.0
Grails home is set to: c:/MyStuff/Tools/grails-1.1.1

Base Directory: C:\MyWork\Source\MyApp
Running script c:\MyStuff\Tools\grails-1.1.1\scripts\War.groovy
Environment set to test
Warning, target causing name overwriting of name cleanAll
Warning, target causing name overwriting of name clean
Warning, target causing name overwriting of name cleanCompiledSources
Warning, target causing name overwriting of name cleanTestReports
Warning, target causing name overwriting of name cleanWarFile
Warning, target causing name overwriting of name startLogging
******************* eventWarStart *****************
clientManager = org.tmatesoft.svn.core.wc.SVNClientManager@2cd728
wcClient = org.tmatesoft.svn.core.wc.SVNWCClient@455aa8
baseFile = C:\MyWork\Source\MyApp
**************** SVN exception **************
svn: 'C:\MyWork\Source\MyApp' is not a working copy


Here's the code:

import org.tmatesoft.svn.core.wc.*;
import org.tmatesoft.svn.core.*;
import org.tmatesoft.svn.core.io.*;
import org.tmatesoft.svn.core.internal.io.dav.DAVRepositoryFactory;
import org.tmatesoft.svn.core.internal.io.fs.FSRepositoryFactory;
import org.tmatesoft.svn.core.internal.io.svn.SVNRepositoryFactoryImpl;

eventWarStart = { type ->
   println "******************* eventWarStart *****************"
 try {
     // initialise SVNKit
     DAVRepositoryFactory.setup();
     SVNRepositoryFactoryImpl.setup();
     FSRepositoryFactory.setup();
           SVNClientManager clientManager = SVNClientManager.newInstance();
     println "clientManager = " + clientManager.toString();
     SVNWCClient wcClient = clientManager.getWCClient();
     println "wcClient = " + wcClient.toString();

     // the svnkit equivalent of "svn info"
     File baseFile = new File(basedir);

     println "baseFile = " + baseFile.toString();
     SVNInfo svninfo = wcClient.doInfo(baseFile, SVNRevision.WORKING);
     println "svninfo = " + svninfo.toString();

     def version = svninfo.getURL();
     println "Setting Version to: ${version}"
     metadata.'app.version' = "${version}".toString()
     metadata.persist()

 }
 catch (SVNException ex) {
     //something went wrong
     println "**************** SVN exception **************"
     println ex.getMessage();
 }
 } // End eventWarStart()

---------------------------------------------------------------------
To unsubscribe, e-mail: svnkit-users-unsubscribe@...
For additional commands, e-mail: svnkit-users-help@...




--
Dan HE :)