Feature #1536
openUsing libsvn
Added by Pierre Paysant-Le Roux over 16 years ago. Updated over 10 years ago.
90%
Description
Tigris provides a high level ruby api named libsvn (subversion/bindings/swig/ruby in the sources of subversion). It could maybe simplify the way Redmine handles subversion repositories by avoiding out shelling.
Have someone tested this lib ? Is this lib voluntary not used in Redmine ?
Files
patch_libsvn (15.7 KB) patch_libsvn | A subversion adapter using libsvn ruby bindings | Pierre Paysant-Le Roux, 2009-05-03 19:34 |
Related issues
Updated by Jean-Philippe Lang over 16 years ago
The main reason why it's not used in Redmine is that there's no binaries available for windows.
I don't know if this lib has all the necessary functionalities to be used in Redmine, can you point to the documentation of this API please ?
Updated by Pierre Paysant-Le Roux over 16 years ago
There is no documentation specific to the ruby bindings. Here is the documentation of the subversion API. I think that the lib has more than all the necessary functionalities the be used in Redmine. I am not convinced that maintaining a Windows compatibility for a server software like Redmine is crucial.
However, it's also possible to have an adapter based on libsvn for Unices and an adapter that uses command line calls for Windows or non libsvn users. I can try to implement this adapter to show if there is a real benefit (memory footprint, cpu or io usage, code simplicity).
Moreover, no ruby bindings exists for all api (Mercurial for example).
Updated by Jean-Philippe Lang over 16 years ago
For sure, it would be faster.
Having an alternate adapter that uses libsvn would be nice indeed.
Updated by Pierre Paysant-Le Roux over 15 years ago
- File patch_libsvn patch_libsvn added
- % Done changed from 0 to 90
I finally succeed in implementing a subversion adapter based on libsvn. I wrote some non regression tests (should be completed). The adapter pass functional and unit tests of the adapter based on svn command line. At the moment, I made no benchmarking. I will write something like parsing a repository with 1000 changesets to see if there is some speed improvement.
Updated by Pierre Paysant-Le Roux over 15 years ago
A simple benchmark : calling Adapter#revisions
method on a local repository with 1000 simple changesets :
user system total real libsvn 0.150000 0.020000 0.170000 ( 0.230447) svn command 8.150000 0.480000 8.750000 ( 8.987669)
Updated by Jens Goldhammer over 15 years ago
+10! Great. Please integrate it into trunk
Updated by Jean-Philippe Lang over 15 years ago
Looks great! I just found a small bug in the diff view, it seems you need to swap identifier_to and identifier_from in SubversionLibsvnAdapter#diff.
But I think we shouldn't introduce a new Repository class (eg. SubversionLibsvn) since this is not a new kind of repository, but just an other way to read a Subversion repository. I think your patch could be released as a plugin that overides the default adapter. Existing repositories will use this new adapter as well.
Updated by Pierre Paysant-Le Roux over 15 years ago
Jean-Philippe Lang wrote:
I think your patch could be released as a plugin that overides the default adapter. Existing repositories will use this new adapter as well.
Because plugins are loaded first, it's hard to override methods with a plugin. Do you have an idea on how to implement that ?
Updated by Eric Davis over 15 years ago
Pierre Paysant-Le Roux wrote:
Because plugins are loaded first, it's hard to override methods with a plugin. Do you have an idea on how to implement that ?
You can have the plugin load the required files it needs to override. For example:
require_dependency 'subversion_adapter' # Might need to use redmine/scm/adapaters/subversion_adapter
module Redmine
module Scm
module Adapters
class SubversionAdapter < AbstractAdapter
# Override code here.
end
end
end
end
You can also use the module include pattern if you don't want to reopen the SubversionAdapter
class.
Updated by Pierre Paysant-Le Roux over 15 years ago
I created a plugin. It is available on github :
http://github.com/pplr/redmine-libsvn/tree/master
Suggestions and beta testers are welcome !
Updated by Jean-Philippe Lang almost 15 years ago
I've just tested your plugin and found that #properties
uses infinite depth, which is wrong and horribly slow (13s on Redmine repository root).
Here is a fix:
--- subversion_libsvn_adapter.rb Sun Dec 20 12:31:16 2009 +++ subversion_libsvn_adapter_fix.rb Sun Dec 20 12:28:55 2009 @@ -100,7 +100,7 @@ def properties(path, identifier=nil) identifier = (identifier and identifier.to_i > 0) ? identifier.to_i : "HE AD" properties = {} - ctx.proplist(target(path), identifier) do |path, prop_hash| + ctx.proplist(target(path), identifier, nil, false) do |path, prop_hash| properties.merge!(prop_hash) end properties
Apart from that, it's really faster than the current implementation.
Updated by Pierre Paysant-Le Roux almost 15 years ago
Thanks for feedback. I pushed a bugfix for #properties.
Updated by Pierre Paysant-Le Roux almost 15 years ago
- Status changed from New to Resolved
Updated by Mischa The Evil about 13 years ago
- Status changed from Resolved to New
Resolved is used for merging-purposes.
Updated by Mischa The Evil about 13 years ago
- Target version set to Unplanned backlogs
Updated by Rafi Greenberg almost 13 years ago
I would like to see libsvn work for the stable/trunk versions of Redmine. Somewhere along the line the pplr plugin http://github.com/pplr/redmine-libsvn/tree/master broke.
I wish this would be part of the official build! Anyone else agree?
Updated by Rafi Greenberg over 12 years ago
Anyone interested in porting this to Redmine 2.0.x?
Updated by William Baum almost 12 years ago
Jean-Philippe Lang wrote:
The main reason why it's not used in Redmine is that there's no binaries available for windows.
I've actually been running the libsvn plugin on Windows for years with win32svn binaries available in the win32svn project on sourceforge: http://sourceforge.net/projects/win32svn/ And yes, it's dramatically faster.
So if the lack of Windows binaries was the primary obstacle, can we get libsvn into the core now?
Updated by Sen Haerens over 10 years ago
I updated the init.rb for Redmine 2.x and the plugin seems to work fine with Redmine 2.5.1.