Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move/Copy commands in eclipse loses the SVN-history #22

Closed
oilid opened this issue Sep 11, 2018 · 41 comments
Closed

Move/Copy commands in eclipse loses the SVN-history #22

oilid opened this issue Sep 11, 2018 · 41 comments

Comments

@oilid
Copy link

oilid commented Sep 11, 2018

Hey @ContextQuickie,

during my work with eclipse I recognized a really bad issue if I use the refactoring command in eclipse for example with moving a resource / java file. So in this case the svn history is of course lost because tortoise svn doesn't recognize these move/copy commands by eclipse. In "Windows explorer" moving a resource (for keeping the svn history) is done by moving and releasing it with the right mouse button. But this couldn't be done in eclipse and would of cource does not include the nice eclipse refactoring feature.

Do you have any idea if this problem could be workarounded or solved?

Best regards!

@ContextQuickie
Copy link
Owner

Hello @oilid ,
as far as a saw there is no option to drag and drop files/folders in eclipse using the right mouse button. There are probably two solutions:

  • Monitor file copies/movements and apply them also to the repository. I assume the native Eclipse SVN plugins do it somehow in this way
  • Add a key combination (e.g. pressing Ctrl or Shift during copying/moving) to show a Tortoise style menu for the action. In short tests I didn't yet figure out how to do this

@oilid
Copy link
Author

oilid commented Sep 11, 2018

Thanks so long for your support!
Do you think the first option is realisable? I think this would be the best...

@ContextQuickie
Copy link
Owner

Hello @oilid ,
I had a look at the eclipse documentation. I figured out how to listen to move events to get the source and destination path of the operation but it seems to be difficult to get the same information for copy events (see also https://bugs.eclipse.org/bugs/show_bug.cgi?id=217489 and https://bugs.eclipse.org/bugs/show_bug.cgi?id=109166). As soon as getting all the information from a copy operation is working there are some additional steps required:

  • Check if the files are versioned items in a working copy
  • Provide the copy/move information to the underlying SVN/Git system

If you find any information how to track copy operations with retrieving the source and destination path for the operation, you will help me a lot.
I think I have to use JNI or SVNKit to get the remaining steps working so it's a bit more effort.

@oilid
Copy link
Author

oilid commented Sep 19, 2018

Hey,

In that case eclipse is really stupid. I didn't imagine some "enhancements" like this are not supported :-/ Unfortunately I don't know how to solve this issue.
But I think the move and rename events are more important than the copy one.

So do you think it is possible to handle these both events (rename and move)?

ContextQuickie added a commit that referenced this issue Sep 20, 2018
@ContextQuickie
Copy link
Owner

ContextQuickie commented Sep 23, 2018

Hello @oilid ,
another possibility is to implement a team provider for ContextQuickie in which I can provide an implementation of IResourceRuleFactory which will provide all required information I need.
Thats probably the way other Git/SVN integrations for eclipse do it.

You would have to enable the team provider in the project context menu:
image

There I can add an entry for Tortoise SVN:
image

Do you currently use any other SVN team provider for your eclipse projects? As far as a saw there can only be one at a time.

@oilid
Copy link
Author

oilid commented Sep 24, 2018

Hey @ContextQuickie ,

I think this would be great. No, we don't use any other team provider. We just removed Subclipse because of several performance issues and moved to your solution.
So be careful concerning the performance (for example during the incrementell build of eclipse)...

If you have a first developing release, I will have a look especially concerning this performance issue (our project is really big and monolithic)...

ContextQuickie added a commit that referenced this issue Sep 28, 2018
@ContextQuickie
Copy link
Owner

Hello @oilid ,
I created a first test version which only tracks the copy/move/add operations in the project and does some console output in case of a match. Currently there is no SVN operation performed. It's just to check the performance with an "empty" implementation.
You'll find it in the development update site (http://contextquickie.github.io/ContextQuickie/Development): ContextQuickie.TeamProvider.
If you do some tests with it, please use a separate/new eclipse workspace for it.

@oilid
Copy link
Author

oilid commented Sep 28, 2018

Hey @ContextQuickie,

I just checked your development version and new team provider. But I can't see any output in eclipse. So in which console I can check your "System.out.format"? Without an output I don't know if your implementation is "handled"/requested.

Greetz
Oilid

@ContextQuickie
Copy link
Owner

ContextQuickie commented Sep 28, 2018

Hello @oilid ,
you'll see the output if you execute eclipsec.exe on the command line. There should be output when copying/mvoing files like:

resourceChanged: moved C:\TortoiseSvn\1.10.1\appveyor.yml to C:\TortoiseSvn\1.10.1\www\appveyor.yml
resourceChanged: copied C:\TortoiseSvn\1.10.1\version.build.in to C:\TortoiseSvn\1.10.1\www\version.build.in

The output isn't very important, more interesting from my side is if there are any performance issues with it.

@oilid
Copy link
Author

oilid commented Sep 28, 2018

Ah okay, thanks! I will check this the next days :)

@ContextQuickie
Copy link
Owner

ContextQuickie commented Sep 28, 2018

Ok, if you have some time left: I'll add a new version to the development site supporting copy/move/add single files by using SVNKit 1.8.15 (Please install it before updating the ContextQuickie TeamProvider from http://eclipse.svnkit.com/1.8.x). Do not use version 1.9.x, this seems to be an incompatible version, I'm working on it.
What is not tested/working:

  • Copying or Moving multiple files/folders
  • Using linked resources
  • Multiple SVN repositories in one project
  • Copying from one project to another

@oilid
Copy link
Author

oilid commented Sep 29, 2018

Hey @ContextQuickie,

thanks a lot. I tested some use cases and generally it works. But I had just some problems:

  • When I copy a file from one source folder to another, this file will be added as svn resource in the build (target) folder:

resourceChanged: copied C:\Users\blubb\eclipse-workspace\taglib-trunk\src\main\java\de\work\bmanwfam\TestModel.java to C:\Users\blubb\eclipse-workspace\taglib-trunk\src\main\java\de\work\bmanwfam\taglib2\images\TestModel.java
resourceChanged: added L/taglib-trunk/target/classes/de/work/bmanwfam/taglib2/images/TestModel.class

grafik

The target folder is a svn ignore resource, so this is not useful and wrong.

  • When I rename a package / folder (from "de.work.bmanwfam" to "de.work.foo" for example) in eclipse I will get this exception:
resourceChanged: moved C:\Users\blubb\eclipse-workspace\taglib-trunk\src\main\java\de\work\bmanwfam\TestModel.java to C:\Users\blubb\eclipse-workspace\taglib-trunk\src\main\java\de\work\foo\TestModel.java
resourceChanged: added F/taglib-trunk/src/main/java/de/work/foo
org.tmatesoft.svn.core.SVNException: svn: E155010: Path 'C:\Users\blubb\eclipse-workspace\taglib-trunk\src\main\java\de\work\foo' is not a directory
        at org.tmatesoft.svn.core.internal.wc.SVNErrorManager.error(SVNErrorManager.java:70)
        at org.tmatesoft.svn.core.internal.wc.SVNErrorManager.error(SVNErrorManager.java:57)
        at org.tmatesoft.svn.core.internal.wc2.ng.SvnNgWcToWcCopy.verifyPaths(SvnNgWcToWcCopy.java:481)
        at org.tmatesoft.svn.core.internal.wc2.ng.SvnNgWcToWcCopy.copy(SvnNgWcToWcCopy.java:349)
        at org.tmatesoft.svn.core.internal.wc2.ng.SvnNgWcToWcCopy.tryRun(SvnNgWcToWcCopy.java:92)
        at org.tmatesoft.svn.core.internal.wc2.ng.SvnNgWcToWcCopy.run(SvnNgWcToWcCopy.java:69)
        at org.tmatesoft.svn.core.internal.wc2.ng.SvnNgWcToWcCopy.run(SvnNgWcToWcCopy.java:37)
        at org.tmatesoft.svn.core.internal.wc2.ng.SvnNgOperationRunner.run(SvnNgOperationRunner.java:20)
        at org.tmatesoft.svn.core.internal.wc2.SvnOperationRunner.run(SvnOperationRunner.java:21)
        at org.tmatesoft.svn.core.wc2.SvnOperationFactory.run(SvnOperationFactory.java:1235)
        at org.tmatesoft.svn.core.wc2.SvnOperation.run(SvnOperation.java:294)
        at org.tmatesoft.svn.core.wc.SVNMoveClient.doVirtualCopy(SVNMoveClient.java:307)
        at contextquickie.teamprovider.svn.ResourceDeltaVisitor$1.run(ResourceDeltaVisitor.java:97)
        at org.eclipse.core.internal.jobs.Worker.run(Worker.java:56)
deleteRule: C:\Users\blubb\eclipse-workspace\taglib-trunk\target\classes\de\work\bmanwfam\TestModel.class
resourceChanged: added L/taglib-trunk/target/classes/de/work/foo/TestModel.class

From these points:

What is not tested/working:

- Copying or Moving multiple files/folders
- Using linked resources
- Multiple SVN repositories in one project
- Copying from one project to another

I think the first one is the most important one...

By the way: the performance is with my small test project is great but of course I have to test it with our big project another time again ;-)

Best regards!

ContextQuickie added a commit that referenced this issue Sep 30, 2018
ContextQuickie added a commit that referenced this issue Sep 30, 2018
* Try to fix copying/moving of whole directories (Issue #22)
* Skipped copying/moving of files if the target parent folder is not versioned (Issue #22)
* Skipped adding of new files if parent folder is not versioned (Issue #22)
* Moved adding files to a background job
@ContextQuickie
Copy link
Owner

Hello @oilid ,
i added an update to the development update site which should fix the issues you mentioned. Can you please have a look at it?

@oilid
Copy link
Author

oilid commented Sep 30, 2018

Hey @ContextQuickie,

both issues result in exceptions:

  1. Copy the file:
resourceChanged: copied C:\Users\blubb\eclipse-workspace\taglib-trunk\src\main\java\de\work\bmanwfam\TestModel.java to C:\Users\blubb\eclipse-workspace\taglib-trunk\src\main\java\de\work\bmanwfam\taglib2\images\TestModel.java
resourceChanged: added L/taglib-trunk/target/classes/de/work/bmanwfam/taglib2/images/TestModel.class
org.tmatesoft.svn.core.SVNException: svn: E155010: The node 'C:\Users\blubb\eclipse-workspace\taglib-trunk\target\classes\de\work\bmanwfam\taglib2\images' was not found
        at org.tmatesoft.svn.core.internal.wc.SVNErrorManager.error(SVNErrorManager.java:70)
        at org.tmatesoft.svn.core.internal.wc.SVNErrorManager.error(SVNErrorManager.java:57)
        at org.tmatesoft.svn.core.internal.wc2.ng.SvnNgGetStatus.run(SvnNgGetStatus.java:62)
        at org.tmatesoft.svn.core.internal.wc2.ng.SvnNgGetStatus.run(SvnNgGetStatus.java:27)
        at org.tmatesoft.svn.core.internal.wc2.ng.SvnNgOperationRunner.run(SvnNgOperationRunner.java:20)
        at org.tmatesoft.svn.core.internal.wc2.SvnOperationRunner.run(SvnOperationRunner.java:21)
        at org.tmatesoft.svn.core.wc2.SvnOperationFactory.run(SvnOperationFactory.java:1235)
        at org.tmatesoft.svn.core.wc2.SvnOperation.run(SvnOperation.java:294)
        at org.tmatesoft.svn.core.wc.SVNStatusClient.doStatus(SVNStatusClient.java:363)
        at org.tmatesoft.svn.core.wc.SVNStatusClient.doStatus(SVNStatusClient.java:422)
        at org.tmatesoft.svn.core.wc.SVNStatusClient.doStatus(SVNStatusClient.java:384)
        at contextquickie.teamprovider.svn.ResourceDeltaVisitor$1.run(ResourceDeltaVisitor.java:108)
        at org.eclipse.core.internal.jobs.Worker.run(Worker.java:56)

But the file is copied correctly, so the file "TestModel.java" is shown a new svn resource in the target folder. But unfortunately the mentioned exception occurs.

  1. Rename the package:
resourceChanged: moved C:\Users\blubb\eclipse-workspace\taglib-trunk\src\main\java\de\work\bmanwfam\TestModel.java to C:\Users\blubb\eclipse-workspace\taglib-trunk\src\main\java\de\work\foo\TestModel.java
resourceChanged: added F/taglib-trunk/src/main/java/de/work/foo
deleteRule: C:\Users\blubb\eclipse-workspace\taglib-trunk\target\classes\de\work\bmanwfam\TestModel.class
resourceChanged: added L/taglib-trunk/target/classes/de/work/foo/TestModel.class
org.tmatesoft.svn.core.SVNException: svn: E155010: The node 'C:\Users\blubb\eclipse-workspace\taglib-trunk\target\classes\de\work\foo' was not found
        at org.tmatesoft.svn.core.internal.wc.SVNErrorManager.error(SVNErrorManager.java:70)
        at org.tmatesoft.svn.core.internal.wc.SVNErrorManager.error(SVNErrorManager.java:57)
        at org.tmatesoft.svn.core.internal.wc2.ng.SvnNgGetStatus.run(SvnNgGetStatus.java:62)
        at org.tmatesoft.svn.core.internal.wc2.ng.SvnNgGetStatus.run(SvnNgGetStatus.java:27)
        at org.tmatesoft.svn.core.internal.wc2.ng.SvnNgOperationRunner.run(SvnNgOperationRunner.java:20)
        at org.tmatesoft.svn.core.internal.wc2.SvnOperationRunner.run(SvnOperationRunner.java:21)
        at org.tmatesoft.svn.core.wc2.SvnOperationFactory.run(SvnOperationFactory.java:1235)
        at org.tmatesoft.svn.core.wc2.SvnOperation.run(SvnOperation.java:294)
        at org.tmatesoft.svn.core.wc.SVNStatusClient.doStatus(SVNStatusClient.java:363)
        at org.tmatesoft.svn.core.wc.SVNStatusClient.doStatus(SVNStatusClient.java:422)
        at org.tmatesoft.svn.core.wc.SVNStatusClient.doStatus(SVNStatusClient.java:384)
        at contextquickie.teamprovider.svn.ResourceDeltaVisitor$1.run(ResourceDeltaVisitor.java:108)
        at org.eclipse.core.internal.jobs.Worker.run(Worker.java:56)

So both issues has a dependency to the target (build) folder which is on svn ignore...

@ContextQuickie
Copy link
Owner

Hello @oilid ,
I updated the implementation to fix this error. But renaming packages in the Java Project Exlporer is not yet working completely (e.g. renaming a package and renaming it again to the old name). I have to check for a better solution for this.

@oilid
Copy link
Author

oilid commented Oct 1, 2018

Hey @ContextQuickie,

the exceptions are not shown anymore. The copy and rename file commands work as expected.
But renaming a package runs into the problem loosing the history of the containing file.
This was the console output for renaming the package:

resourceChanged: moved C:\Users\blubb\eclipse-workspace\taglib-trunk\src\main\java\de\bmiag\bmanwfam\TestModel.java to C:\Users\blubb\eclipse-workspace\taglib-trunk\src\main\java\de\bmiag\foo\TestModel.java
resourceChanged: added F/taglib-trunk/src/main/java/de/bmiag/foo
deleteRule: C:\Users\blubb\eclipse-workspace\taglib-trunk\target\classes\de\bmiag\bmanwfam\TestModel.class
resourceChanged: added L/taglib-trunk/target/classes/de/bmiag/foo/TestModel.class

The file TestModel.java will be handled as completley new file with a new history but this wrong (the screenshot shows "Show Log" on this file):
grafik

Before this screenshot and after renaming the package from "de.work.bmanwfam" to "de.work.foo" I got TestModel.java marked as missing file (shown in the tortoise svn commit window).

Greetings :-)

@ContextQuickie
Copy link
Owner

ContextQuickie commented Oct 1, 2018

Hello @oilid ,
Eclipse seems to distinguish between folders containing only one file (your case) and folders containing more than one file (what I used for testing, not yet sure where the limit is). Can you confirm that?
I'll check how to handle it correctly.

@ContextQuickie
Copy link
Owner

@oilid: Next version is available at the development update site. Can you please have a look at it?

ContextQuickie added a commit that referenced this issue Oct 8, 2018
ContextQuickie added a commit that referenced this issue Oct 8, 2018
@ContextQuickie
Copy link
Owner

Hello @oilid,
I created a new version, is there any improvement?

@oilid
Copy link
Author

oilid commented Oct 15, 2018

Hey @ContextQuickie,

sorry for the delay, now I'm available again :-)
I updated to the newest version of ContextQuickie.TeamProvider 0.1.0.201810081938 but the problem still exists when I rename a package from "de.work.bmanwfam.taglib2" to "de.work.bmanwfam.muh" with 33 files inside.

This is the log output:

resourceChanged: moved C:\Users\blubb\eclipse-workspace\taglib-trunk\src\main\java\de\bmiag\bmanwfam\taglib2\InputInfoIfc.java to C:\Users\blubb\eclipse-workspace\taglib-trunk\src\main\java\de\work\bmanwfam\muh\InputInfoIfc.java
resourceChanged: added F/taglib-trunk/src/main/java/de/work/bmanwfam/muh
deleteRule: C:\Users\blubb\eclipse-workspace\taglib-trunk\target\classes\de\bmiag\bmanwfam\taglib2\AbstractBaseTag.class
deleteRule: C:\Users\blubb\eclipse-workspace\taglib-trunk\target\classes\de\bmiag\bmanwfam\taglib2\AbstractInputTag.class
deleteRule: C:\Users\blubb\eclipse-workspace\taglib-trunk\target\classes\de\bmiag\bmanwfam\taglib2\AttrInfoFieldTag.class
deleteRule: C:\Users\blubb\eclipse-workspace\taglib-trunk\target\classes\de\bmiag\bmanwfam\taglib2\BooleanFieldSelectionInfo.class
deleteRule: C:\Users\blubb\eclipse-workspace\taglib-trunk\target\classes\de\bmiag\bmanwfam\taglib2\BooleanFieldTag.class
deleteRule: C:\Users\blubb\eclipse-workspace\taglib-trunk\target\classes\de\bmiag\bmanwfam\taglib2\BrowserCheck.class
deleteRule: C:\Users\blubb\eclipse-workspace\taglib-trunk\target\classes\de\bmiag\bmanwfam\taglib2\ButtonTag.class
deleteRule: C:\Users\blubb\eclipse-workspace\taglib-trunk\target\classes\de\bmiag\bmanwfam\taglib2\DOJORenderer.class
deleteRule: C:\Users\blubb\eclipse-workspace\taglib-trunk\target\classes\de\bmiag\bmanwfam\taglib2\DateFieldTag.class
deleteRule: C:\Users\blubb\eclipse-workspace\taglib-trunk\target\classes\de\bmiag\bmanwfam\taglib2\GroupTag.class
deleteRule: C:\Users\blubb\eclipse-workspace\taglib-trunk\target\classes\de\bmiag\bmanwfam\taglib2\GroupTagBeratung.class
deleteRule: C:\Users\blubb\eclipse-workspace\taglib-trunk\target\classes\de\bmiag\bmanwfam\taglib2\HelpButtonTag.class
deleteRule: C:\Users\blubb\eclipse-workspace\taglib-trunk\target\classes\de\bmiag\bmanwfam\taglib2\InputInfoIfc.class
deleteRule: C:\Users\blubb\eclipse-workspace\taglib-trunk\target\classes\de\bmiag\bmanwfam\taglib2\LabelInfo.class
deleteRule: C:\Users\blubb\eclipse-workspace\taglib-trunk\target\classes\de\bmiag\bmanwfam\taglib2\LabelInfoIfc.class
deleteRule: C:\Users\blubb\eclipse-workspace\taglib-trunk\target\classes\de\bmiag\bmanwfam\taglib2\ListExchangeTag.class
deleteRule: C:\Users\blubb\eclipse-workspace\taglib-trunk\target\classes\de\bmiag\bmanwfam\taglib2\Netscape461OS2Renderer.class
deleteRule: C:\Users\blubb\eclipse-workspace\taglib-trunk\target\classes\de\bmiag\bmanwfam\taglib2\Netscape461OS2Renderer$SelectionFieldComparator.class
deleteRule: C:\Users\blubb\eclipse-workspace\taglib-trunk\target\classes\de\bmiag\bmanwfam\taglib2\SelectionFieldComparator.class
deleteRule: C:\Users\blubb\eclipse-workspace\taglib-trunk\target\classes\de\bmiag\bmanwfam\taglib2\SelectionFieldTag.class
deleteRule: C:\Users\blubb\eclipse-workspace\taglib-trunk\target\classes\de\bmiag\bmanwfam\taglib2\SelectionInputInfoIfc.class
deleteRule: C:\Users\blubb\eclipse-workspace\taglib-trunk\target\classes\de\bmiag\bmanwfam\taglib2\StyleInfoIfc.class
deleteRule: C:\Users\blubb\eclipse-workspace\taglib-trunk\target\classes\de\bmiag\bmanwfam\taglib2\StyleInfoWrapper.class
deleteRule: C:\Users\blubb\eclipse-workspace\taglib-trunk\target\classes\de\bmiag\bmanwfam\taglib2\SubmitButtonTag.class
deleteRule: C:\Users\blubb\eclipse-workspace\taglib-trunk\target\classes\de\bmiag\bmanwfam\taglib2\TableCheckBoxTag.class
deleteRule: C:\Users\blubb\eclipse-workspace\taglib-trunk\target\classes\de\bmiag\bmanwfam\taglib2\TableComboBoxTag.class
deleteRule: C:\Users\blubb\eclipse-workspace\taglib-trunk\target\classes\de\bmiag\bmanwfam\taglib2\TableCreator.class
deleteRule: C:\Users\blubb\eclipse-workspace\taglib-trunk\target\classes\de\bmiag\bmanwfam\taglib2\TableDateFieldTag.class
deleteRule: C:\Users\blubb\eclipse-workspace\taglib-trunk\target\classes\de\bmiag\bmanwfam\taglib2\TableRowSelectionTag.class
deleteRule: C:\Users\blubb\eclipse-workspace\taglib-trunk\target\classes\de\bmiag\bmanwfam\taglib2\TableSelectionFieldTag.class
deleteRule: C:\Users\blubb\eclipse-workspace\taglib-trunk\target\classes\de\bmiag\bmanwfam\taglib2\TableTag.class
deleteRule: C:\Users\blubb\eclipse-workspace\taglib-trunk\target\classes\de\bmiag\bmanwfam\taglib2\TableTextFieldTag.class
deleteRule: C:\Users\blubb\eclipse-workspace\taglib-trunk\target\classes\de\bmiag\bmanwfam\taglib2\TextFieldTag.class
deleteRule: C:\Users\blubb\eclipse-workspace\taglib-trunk\target\classes\de\bmiag\bmanwfam\taglib2\TextInputInfoIfc.class
resourceChanged: added L/taglib-trunk/target/classes/de/work/bmanwfam/muh/TextInputInfoIfc.class

The resources are all marked as missing in the commit dialog:
grafik

And the svn history is lost:
grafik

Can you reproduce the problem and may fix it?

@oilid
Copy link
Author

oilid commented Nov 29, 2018

Hey @ContextQuickie,

do you still have this issue on focus?

Best regards,
Oilid

@ContextQuickie
Copy link
Owner

Hi @oilid ,
yes, I didn't forget it. Curretly I don't hvae a lot time but I hopefully can provide a about two weeks.
BR
Roland

@ContextQuickie
Copy link
Owner

Hello @oilid,
is it possible for you to install Silk SVN (https://sliksvn.com/download/)? If yes: are there any improvements with the latest version from the development update site?
You should use the same architecture (32/64 bit) as your eclipse java runtime.

BR
Roland

@oilid
Copy link
Author

oilid commented Dec 10, 2018

Hey Roland,

are still using SVNKit or Silk SVN now?

Because on a fresh eclipse installation I can't install Context Quickie:

Cannot complete the install because one or more required items could not be found.
Software being installed: ContextQuickie.TeamProvider 0.1.0.201811041105 (ContextQuickie.TeamProvider.feature.group 0.1.0.201811041105)
Missing requirement: ContextQuickie.TeamProvider 0.1.0.201811041105 (ContextQuickie.TeamProvider.feature.group 0.1.0.201811041105) requires 'org.eclipse.equinox.p2.iu; org.tmatesoft.svnkit 1.8.15' but it could not be found

Greetings
Oilid

@ContextQuickie
Copy link
Owner

Hi @oilid ,
it should be Silk SVN. I removed the dependency to SVNKit.
BR
Roland

@oilid
Copy link
Author

oilid commented Dec 10, 2018

How can you use a windows application as dependency? I think thats why i'm getting now:

java.lang.NoClassDefFoundError: Could not initialize class org.apache.subversion.javahl.SVNClient

JavaHL is part of Silk SVN? I installed the Silk SVN 64 bit and I'm using the same enviroment for eclipse (Version: 2018-09 (4.9.0)).

@ContextQuickie
Copy link
Owner

I need SilkSVN to provide the library libsvnjavahl-1.dll and it's dependencies. The SilkSVN path (e.g. C:\Program Files\SlikSvn\bin) should be in the Windows path environment variable so that my plugin can find the required dll(s).

@oilid
Copy link
Author

oilid commented Dec 10, 2018

Hey Roland,

okay, now I understand your purpose. I added the SlikSVN-Path to the path environment variable and it worked. All my tests (renaming / refactoring etc.) run successfully.
But I have some pain with this solution because its really fragile :-/

Is there no chance for svnkit?

Because ContextQuickie is used for maybe 30 developers in our company and with these preconditions everyone has to get SlikSVN and has to change Windows path environment variable manually. And is there no conflict if "C:\Program Files\SlikSvn\bin" and "C:\Program Files\TortoiseSVN\bin" are both in the path at the same time (because of svn.exe etc.)?

Please do not understand these questions/critique wrong. I'm really happy about your work and support :-)

@ContextQuickie
Copy link
Owner

ContextQuickie commented Dec 10, 2018

Thanks for testing. You're right, that's not the best solution but currently sufficient for testing the implementation. Having two (maybe different) SVN (command line) clients installed at the same time is obviously not practical.
I already tried to include Silk SVN (at least the required dlls) into the plugin but this will cause two plugin versions (one for 32bit, one for 64bit).
if the page is up to date, subclipse works in a similar way: http://subclipse.tigris.org/wiki/JavaHL (Chapter "How do I get JavaHL?")
I'll look for a better solution.
Update: I think Tortoise SVN already provides almost the same libraries than Silk SVN (except the JNI library itself). Maybe a manually implemented JNI wrapper for accessing the Tortoise SVN libraries directly can solve the problem.

@ContextQuickie
Copy link
Owner

Hello @oilid,
which version of Tortoise SVN do you currently use? Is it a 32 or 64 bit version?
BR
Roland

@oilid
Copy link
Author

oilid commented Dec 14, 2018

Hey,

64Bit 😊 the Versionnumber is TortoiseSVN 1.10.1, Build 28295 - 64 Bit.

@ContextQuickie
Copy link
Owner

ContextQuickie commented Dec 15, 2018

Hi @oilid,
next try :-) I added a new version to the development update site which will use the DLLs provided by Tortoise SVN so Silk SVN isn't required anymore. The plugin contains two libraries (32 and 64 bit) which I built from Tortoise SVN 1.11.0. I did a short test with Tortoise SVN 1.11.0 installed and it seems to work as expected. Some remarks:

  • The architecture of the eclipse Java runtime (32 or 64 bit) must match the architecture of the installed Tortoise SVN version. It's not possible to use a 64bit Tortoise SVN with a 32 bit eclipse environment.
  • The path to the bin directory of Tortoise SVN must be present in the PATH environment variable (I think this is automatically done when installing Tortoise SVN)
  • I'm not yet sure about the comatibility of the built libraries. I didn't test if the plugin also works with older Tortoise SVN versions. If you're using an older version, tell me which one and if it is also working.

BR
Roland

@oilid
Copy link
Author

oilid commented Dec 15, 2018

Hey @ContextQuickie,

thanks a lot!

I first tested your new version with TortoiseSVN 1.10.1, Build 28295 - 64 Bit and it fails.
I got these exceptions:

java.lang.LinkageError: Compile-time Native library version is 1.11.0 (r1845130) but the run-time version is 1.10.2
	at org.apache.subversion.javahl.NativeResources.init(NativeResources.java:158)
	at org.apache.subversion.javahl.NativeResources.loadNativeLibrary(NativeResources.java:112)
	at org.apache.subversion.javahl.types.Version.<clinit>(Version.java:40)
	at org.apache.subversion.javahl.NativeResources.init(NativeResources.java:146)
	at org.apache.subversion.javahl.NativeResources.loadNativeLibrary(NativeResources.java:112)
	at org.apache.subversion.javahl.SVNClient.<clinit>(SVNClient.java:52)
	at contextquickie.teamprovider.svn.ResourceDeltaVisitor.isResourceVersioned(ResourceDeltaVisitor.java:223)
	at contextquickie.teamprovider.svn.ResourceDeltaVisitor.doAdd(ResourceDeltaVisitor.java:105)
	at contextquickie.teamprovider.svn.ResourceDeltaVisitor.visit(ResourceDeltaVisitor.java:91)
	at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:67)
	at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:77)
	at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:77)
	at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:77)
	at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:77)
	at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:77)
	at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:77)
	at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:77)
	at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:77)
	at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:51)
	at contextquickie.teamprovider.svn.SvnRepositoryProvider.resourceChanged(SvnRepositoryProvider.java:51)
	at org.eclipse.core.internal.events.NotificationManager$1.run(NotificationManager.java:300)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
	at org.eclipse.core.internal.events.NotificationManager.notify(NotificationManager.java:290)
	at org.eclipse.core.internal.events.NotificationManager.broadcastChanges(NotificationManager.java:153)
	at org.eclipse.core.internal.resources.Workspace.broadcastPostChange(Workspace.java:379)
	at org.eclipse.core.internal.resources.Workspace.endOperation(Workspace.java:1502)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2305)
	at org.eclipse.core.internal.events.NotificationManager$NotifyJob.run(NotificationManager.java:44)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)

and

java.lang.NoClassDefFoundError: Could not initialize class org.apache.subversion.javahl.SVNClient
	at contextquickie.teamprovider.svn.ResourceDeltaVisitor.isResourceVersioned(ResourceDeltaVisitor.java:223)
	at contextquickie.teamprovider.svn.ResourceDeltaVisitor.doAdd(ResourceDeltaVisitor.java:105)
	at contextquickie.teamprovider.svn.ResourceDeltaVisitor.visit(ResourceDeltaVisitor.java:91)
	at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:67)
	at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:77)
	at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:77)
	at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:77)
	at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:77)
	at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:77)
	at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:77)
	at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:77)
	at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:77)
	at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:51)
	at contextquickie.teamprovider.svn.SvnRepositoryProvider.resourceChanged(SvnRepositoryProvider.java:51)
	at org.eclipse.core.internal.events.NotificationManager$1.run(NotificationManager.java:300)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
	at org.eclipse.core.internal.events.NotificationManager.notify(NotificationManager.java:290)
	at org.eclipse.core.internal.events.NotificationManager.broadcastChanges(NotificationManager.java:153)
	at org.eclipse.core.internal.resources.Workspace.broadcastPostChange(Workspace.java:379)
	at org.eclipse.core.internal.resources.Workspace.endOperation(Workspace.java:1502)
	at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:160)
	at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:235)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)

Then I upgraded to TortoiseSVN 1.11.0, Build 28416 - 64 Bit and everything works...

So is there a chance to be more independent from the TortoiseSVN-Version? But I think I can also ask my company to upgrade our TortoiseSVN version from 1.10.1 to 1.11.0 when I checked/tested all impacts of the new version.

@ContextQuickie
Copy link
Owner

ContextQuickie commented Dec 15, 2018

Hi @oilid,
being more independent from the Tortoise SVN version can cause unexpected behavoir if incompatible versions are used. As I don't want to maintain multiple plugin branches for each Tortoise SVN version, I can imagine the following options:

  • I don't include the Tortoise SVN specific DLLs in the plugin, but provide them as additional packages to download. The user has to copy the DLLs to the Tortoise SVN bin directory to get the plugin working. I'm already able to build the DLLs for Tortoise SVN 1.10.2, I'll check if it also possible for version 1.10.1.
  • I add a configuration switch in the preferences for supported Tortoise SVN versions and load the DLLs based on the configured value.
  • I add all supported versions of the DLL to the package and read the Torotise SVN version from the registry before loading the DLL to determine which version must be loaded.

In both cases new Tortoise SVN versions will also cause new DLLs for the plugin. The best long term solution in my opinion: Ask the Tortoise SVN team to provide the DLL with the default installation (similar to Silk SVN).

@oilid
Copy link
Author

oilid commented Dec 17, 2018

Hey Roland,

thanks for your advices!
I think the best option would be the third one.

I add all supported versions of the DLL to the package and read the Torotise SVN version from the registry before loading the DLL to determine which version must be loaded.

So the user has no nothing to care for...
I also think you should add an option to enable/disable this feature for loading the JavaHL DLLs if they are not available.

Best regards and have a nice week,
Oilid

ContextQuickie added a commit that referenced this issue Dec 17, 2018
@ContextQuickie
Copy link
Owner

Hi @oilid,
I added a new version to the development update site which shoud support Tortoise SVN 1.10.1, 1.10.2 and 1.11.0. I tested it only with 1.11.0, can you check one of the previous versions?
Is there a specific UseCase for the enabled/disable option? If there is no Tortoise SVN installed, it doesn't make any sense to use ContextQuickie.TeamProvider.
BR
Roland

@oilid
Copy link
Author

oilid commented Dec 17, 2018

Hey Roland,

it works great now. I tested both versions of TortoiseSVN 1.10.1 and 1.11.0 again.
The version detection of tortoiseSVN in the preferences also works :-)
You are right the enabled/disable option doesn't make sense because of the new "TeamProvider".

So if you like, you can release this version now, I think ;-)

THANKS again!

@ContextQuickie
Copy link
Owner

Hi @oilid,
thanks for testing. A remark from my side: All the settings in the eclipse preferences are only for the context menu, currently there are no settings for the team proivder. The configured/detected Tortoise SVN version only changes the icons and supported menu entries of the context menu.
I added the new version to the Release update site. You can close this issue if there are no further topics from your side.
BR
Roland

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants