This project is archived and is in readonly mode.
Add Hg (Mercurial) support to script/plugin
-
Daniel Schierbeck
I'm getting the following error with Rails 2.1.0:
>> script/plugin install http://www.host.com/hg_repo /home/daniel/test/config/boot.rb:86:in `load_rubygems': undefined method `>=' for nil:NilClass (NoMethodError) from /home/daniel/test/config/boot.rb:52:in `load_initializer' from /home/daniel/test/config/boot.rb:38:in `run' from /home/daniel/test/config/boot.rb:11:in `boot!' from /home/daniel/test/config/boot.rb:109:in `<top (required)>' from script/plugin:2:in `require' from script/plugin:2:in `<main>'You may want to replace
if system("hg version")withif system("hg version") rescue false. -
Daniel Schierbeck
With the message above I meant that there should be a better error message, both when an invalid repo is specified, and also when Hg isn't installed.
-
Daniel Schierbeck
I'm terribly sorry, that error message was caused by me accidentally running your patched code with Ruby 1.9! Just ignore what I wrote.
-
Bounga
no problem. Did you test it with 1.8?
-
Bounga
Nobody interested in Mercurial support?
-
Alex MacCaw
nope ;)
-
Bounga
You don't know what are the good things in life :(
-
Daniel Schierbeck
Bounga: I think we should wait until there's a bigger group of people using Hg with Rails. Even if this patch was to be accepted, the implementation would need to be updated and tested as Rails evolves, and without Hg-using Rails contributors, that probably won't happen.
It's sad, but it's true. The same thing happened to #1291 Make it possible to install plugins with Bazaar, my attempt at getting
script/pluginsupport for Bazaar.I'd like to be proven wrong -- if there indeed is a big need for better support of non-Git SCM's, we could refactor the source to make it easier to accommodate a wider variety of tools.
-
Bounga
The thing is that only supporting svn and git tends to "force" users and new plugin developers to adopt Git even if they don't like it. That's what makes me sad.
At least, I've tried. Nevermind.
-
DHH
Perhaps we could add an API to the script/plugin that plugins could use to add these things? Then you could just install the hg-plugins plugin to be able to install plugins from hg ;).
-
Daniel Schierbeck
David: if people would be willing to review a patch, i guess i could create a simple API for installing plugins.
By the way, would it be preferable if it was possible to use Git submodules through
script/plugin? I tend to use submodules a lot to keep the size of my repos to a bare minimum. -
Bounga
@DHH : Do you mean that we could write plugins (to handle other SCM) to install plugins ? So before installing plugins, we need to install a plugin that add the support for the SCM ? If so, I think it's a bit ... disappointing because it's gonna be a per-project install. If we go this way, we need an API that let install it "in" Rails, not in projects. A gem maybe that can be loaded automatically by Rails projects at initialization.
@Daniel : I'm available to review your code, even for other patches ;) I can help to write code too if you need it.
-
DHH
Yeah, a gem sounds good too. You can follow the example from the generator gems which are also system wide.
-
Daniel Schierbeck
David: would it be okay if I opened a ticket dedicated to this API? I'm thinking of adding a PluginManager class that can be extended by plugins, e.g. GitPluginManager, HTTPPluginManager, etc. Any thoughts on this API? Perhaps just copy the design of the Generator API?
-
DHH
- State changed from new to wontfix
Sounds great to me, Daniel. I think the generator API would be a good way to start from in terms of wiring in the gem support. You might want to assign the new ticket to Jeremy. He did the gem support for generators.
I'll close this in the mean time.
