Dir is not in revision control

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Dir is not in revision control

Enrico Musu
Hi guys,

Let me anticipate that I am quite new, but I am having harsh time in managing a previously checked out (not with svnkit but with the simple svn command in the terminal) working copy from an svn repository.

The problem relies in the fact the SVNWCUtils.isVersionedDirectory doesn't recognize the dir to be under a revision control (the shell svn commands works just fine).

I tried to check out the same directory from the svn repository and perform the same isVersionedDirectory check and it passes it.

Am I forgetting any initialization maybe?

here's the code

<code>
    ....
    private SVNClientManager client;
    private ISVNOptions options;
    ISVNAuthenticationManager auth;

    static {
        DAVRepositoryFactory.setup();
        // for svn (over svn and svn+ssh)
        SVNRepositoryFactoryImpl.setup();
    }
   ...

   {
       ....
        options = SVNWCUtil.createDefaultOptions(true);
        auth = SVNWCUtil.createDefaultAuthenticationManager();
        client = SVNClientManager.newInstance(options, auth);
   }
   ...

public void checkout(File node) throws VCSException {

        File dstPath = new File("/Users/Enrico/SVNTest");
        File wc = new File("/Users/Enrico/work/trunk");

        System.out.println(SVNWCUtil.isVersionedDirectory(dstPath));
        System.out.println(SVNWCUtil.isVersionedDirectory(wc));
    }

dstPath is the directory checked out with svnkit, wc is the pre-existing dir. As a result I get: True and False.



Thx for your help
Enrico

Reply | Threaded
Open this post in threaded view
|

Re: Dir is not in revision control

Alexander Kitaev-4
Hello Enrico,

What version of the native Subversion client do you use? It might be
that you've encountered compatibility issue - latest stable version of
SVNKit does not yet support working copy format produced by Subversion
1.7.0.

Otherwise your code looks fine. SVNWCUtil.isVersionedDirectory method
basically checks for '.svn' child directory presence and whether
'.svn/entries' file within it is valid. By default  '.svn' directory
is not shown by 'ls' command or by a UI tools, so you may miss it
while it is there.

You may also use SVNWCClient.doInfo(...) call - it will not only let
you know whether file or directory is under version control, but also
will report some useful information about it in SVNInfo object.

Alexander Kitaev,
TMate Software,
http://svnkit.com/ - Java [Sub]Versioning Library!
http://hg4j.com/ - Java Mercurial Library!
http://sqljet.com/ - Java SQLite Library!



On 20 October 2011 17:13, Enrico Musu <[hidden email]> wrote:

>
> Hi guys,
>
> Let me anticipate that I am quite new, but I am having harsh time in
> managing a previously checked out (not with svnkit but with the simple svn
> command in the terminal) working copy from an svn repository.
>
> The problem relies in the fact the SVNWCUtils.isVersionedDirectory doesn't
> recognize the dir to be under a revision control (the shell svn commands
> works just fine).
>
> I tried to check out the same directory from the svn repository and perform
> the same isVersionedDirectory check and it passes it.
>
> Am I forgetting any initialization maybe?
>
> here's the code
>
> <code>
>    ....
>    private SVNClientManager client;
>    private ISVNOptions options;
>    ISVNAuthenticationManager auth;
>
>    static {
>        DAVRepositoryFactory.setup();
>        // for svn (over svn and svn+ssh)
>        SVNRepositoryFactoryImpl.setup();
>    }
>   ...
>
>   {
>       ....
>        options = SVNWCUtil.createDefaultOptions(true);
>        auth = SVNWCUtil.createDefaultAuthenticationManager();
>        client = SVNClientManager.newInstance(options, auth);
>   }
>   ...
>
> public void checkout(File node) throws VCSException {
>
>        File dstPath = new File("/Users/Enrico/SVNTest");
>        File wc = new File("/Users/Enrico/work/trunk");
>
>        System.out.println(SVNWCUtil.isVersionedDirectory(dstPath));
>        System.out.println(SVNWCUtil.isVersionedDirectory(wc));
>        SVNWCUtil.
>    }
>
> dstPath is the directory checked out with svnkit, wc is the pre-existing
> dir. As a result I get: True and False.
>
>
>
> Thx for your help
> Enrico
>
>
> --
> View this message in context: http://old.nabble.com/Dir-is-not-in-revision-control-tp32690366p32690366.html
> Sent from the SVNKit - Users mailing list archive at Nabble.com.
>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Dir is not in revision control

Enrico Musu
Hi Alexander,

thanks for your support.
The native version I use is 1.6.16 so it shouldn't be the problem.
But thanks to you I noticed a "weird" structure in the entries files.
The existing working copy does not present an xml structure, the checked out version does.

I've read that Subversion is not using anymore the xml format for the entries files for performance issues, knowing this, how should I look at this? The svnkit libraries expect an xml file, the svn not. Is there a workaround?

Cheers,
Enrico



<quote author="AlexanderKitaev">
Hello Enrico,

What version of the native Subversion client do you use? It might be
that you've encountered compatibility issue - latest stable version of
SVNKit does not yet support working copy format produced by Subversion
1.7.0.

Otherwise your code looks fine. SVNWCUtil.isVersionedDirectory method
basically checks for '.svn' child directory presence and whether
'.svn/entries' file within it is valid. By default  '.svn' directory
is not shown by 'ls' command or by a UI tools, so you may miss it
while it is there.

You may also use SVNWCClient.doInfo(...) call - it will not only let
you know whether file or directory is under version control, but also
will report some useful information about it in SVNInfo object.

Alexander Kitaev,
TMate Software,
http://svnkit.com/ - Java [Sub]Versioning Library!
http://hg4j.com/ - Java Mercurial Library!
http://sqljet.com/ - Java SQLite Library!
Reply | Threaded
Open this post in threaded view
|

Re: Dir is not in revision control

Enrico Musu
Hi,

to recap:
- I am currently using Subversion 1.6.16;
- my .svn/entries are not xml like (as introduced in Subversion 1.5+ if I am not mistaken for performance reasons);
- svnKit expects them to be xml like;
- I've tried using svnKit 1.3.6 and 1.7 and both are giving me the same result (error: dir not under version control);

I've tried also to change via svn info --xml  and replacing them with the original entries, but still the result data are different thus leading to a "dir not under version control" error.

Should I assume that the libraries expects always and only xml like entries?
The only workaround I've found so far is to checkout a fresh new working copy. Of course this is quite inconvenient, especially for big projects.

Thx for your support,
Enrico
Reply | Threaded
Open this post in threaded view
|

Re: Dir is not in revision control

Alexander Kitaev-4
Hello Enrico,

> - my .svn/entries are not xml like (as introduced in Subversion 1.5+ if I am
> not mistaken for performance reasons);
> - svnKit expects them to be xml like;

SVNKit 1.3.6 supports both xml and non-xml format of the working copy.
SVNKit 1.7.0 (development version in trunk) also supports new
sqlite-based format of the working copy.

What version of SVNKit do you use?

> - I've tried using svnKit 1.3.6 and 1.7 and both are giving me the same
> result (error: dir not under version control);

What does native Subversion command line client says?

> Should I assume that the libraries expects always and only xml like entries?
No, this is not the case.


> The only workaround I've found so far is to checkout a fresh new working
> copy. Of course this is quite inconvenient, especially for big projects.

In case fresh checkout helped, than might it be that your working copy
has been corrupted somehow? For instance, .svn directory should not
only contain 'entries' file, but also 'format' file.

Alexander Kitaev,
TMate Software,
http://svnkit.com/ - Java [Sub]Versioning Library!
http://hg4j.com/ - Java Mercurial Library!
http://sqljet.com/ - Java SQLite Library!



On 25 October 2011 13:54, Enrico Musu <[hidden email]> wrote:

>
> Hi,
>
> to recap:
> - I am currently using Subversion 1.6.16;
> - my .svn/entries are not xml like (as introduced in Subversion 1.5+ if I am
> not mistaken for performance reasons);
> - svnKit expects them to be xml like;
> - I've tried using svnKit 1.3.6 and 1.7 and both are giving me the same
> result (error: dir not under version control);
>
> I've tried also to change via svn info --xml  and replacing them with the
> original entries, but still the result data are different thus leading to a
> "dir not under version control" error.
>
> Should I assume that the libraries expects always and only xml like entries?
> The only workaround I've found so far is to checkout a fresh new working
> copy. Of course this is quite inconvenient, especially for big projects.
>
> Thx for your support,
> Enrico
>
> --
> View this message in context: http://old.nabble.com/Dir-is-not-in-revision-control-tp32690366p32716944.html
> Sent from the SVNKit - Users mailing list archive at Nabble.com.
>
>
>