Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #9007 (new defect)

Opened 10 months ago

Last modified 8 months ago

[PATCH] script/plugin install -x now recognizes _svn directory on Windows

Reported by: cdemyanovich Assigned to: core
Priority: normal Milestone: 2.x
Component: Railties Version: edge
Severity: normal Keywords: plugin install subversion svn windows
Cc:

Description

"script/plugin install -x" doesn't work on Windows when Subversion working copies use _svn instead of .svn for admin directory names. This patch changes the behavior of "script/plugin install -x" to match that of Subversion.

See http://svn.collab.net/repos/svn/trunk/notes/asp-dot-net-hack.txt for full details.

NOTE: The line

ommands::Plugin.parse!

at the end of railties/lib/commands/plugin.rb caused any require of the file to execute the parse. Since this behavior prevented bringing under test any of the classes in the file, I moved virtually all of railties/lib/commands/plugin.rb to railties/lib/commands/lib/plugin.rb. Although it's a large change, it's worth it to foster testability.

As the railties unit tests on edge are quite broken at the moment, I ran the tests that I added like so:

vader:~/work/rails/railties craig$ ruby test/commands/lib/plugin_install_test.rb

vader:~/work/rails/railties craig$ ruby test/subversion_helper_test.rb

Attachments

plugin_install_when_svn_asp_dot_net_hack.2.diff (58.9 kB) - added by cdemyanovich on 07/18/07 05:19:57.
plugin_install_when_svn_asp_dot_net_hack.diff (58.9 kB) - added by cdemyanovich on 07/21/07 22:36:45.
plugin_install_when_svn_asp_dot_net_hack.diff.gz (10.4 kB) - added by cdemyanovich on 07/21/07 22:39:35.
plugin_install_underscore_svn.diff.gz (10.4 kB) - added by cdemyanovich on 07/21/07 22:42:35.
plugin_install_underscore_svn.diff (58.6 kB) - added by cdemyanovich on 09/21/07 22:06:53.
Same patch with a few bogus comments removed

Change History

07/18/07 05:19:57 changed by cdemyanovich

  • attachment plugin_install_when_svn_asp_dot_net_hack.2.diff added.

07/18/07 12:52:25 changed by cdemyanovich

I'm sorry for the bogus patch file. It looks fine here when I open it in a text editor. Every time I try to attach it, though, I'm greeted with an error, the text of which you can see if you click on the link to the patch file.

Also, the one with a 2 in the name can be removed if anyone knows how.

(follow-up: ↓ 3 ) 07/20/07 03:07:55 changed by nzkoz

I guess you're hitting a file size limit, or perhaps the content of the file is weird. Do you have some other webspace you can upload it to? alternatively maybe gzip the patch?

07/21/07 22:36:45 changed by cdemyanovich

  • attachment plugin_install_when_svn_asp_dot_net_hack.diff added.

07/21/07 22:39:35 changed by cdemyanovich

  • attachment plugin_install_when_svn_asp_dot_net_hack.diff.gz added.

07/21/07 22:42:35 changed by cdemyanovich

  • attachment plugin_install_underscore_svn.diff.gz added.

(in reply to: ↑ 2 ) 07/21/07 23:07:15 changed by cdemyanovich

Replying to nzkoz:

I guess you're hitting a file size limit, or perhaps the content of the file is weird. Do you have some other webspace you can upload it to? alternatively maybe gzip the patch?

Thanks for the suggestions. I tried to shorten the name and/or compress the file, but the upload still failed. The patch can be obtained here:

http://demmer12.fastmail.us/plugin_install_underscore_svn.diff

09/21/07 21:47:43 changed by zdennis

+1 for this patch.

I tested this against trunk revision 7528. It works correctly when using the ASP_DOT_NECK_HACK fix for subversion. This should ease some pain for windows users who are currently using this for .NET projects, etc.

railties/lib/plugin.rb got split up into two files so now you can hook into the Plugin code (where as before it was impossible since the end of commands/plugin.rb immediately executed the plugin code).

09/21/07 22:04:35 changed by cdemyanovich

I forgot to remove a few comments from my original patch, so I'm resubmitting it with those cleaned up.

09/21/07 22:06:53 changed by cdemyanovich

  • attachment plugin_install_underscore_svn.diff added.

Same patch with a few bogus comments removed

09/21/07 22:09:52 changed by cdemyanovich

Still no joy attaching patch, so it can be obtained from:

http://demmer12.fastmail.us/plugin_install_underscore_svn.diff

09/21/07 22:20:39 changed by zdennis

The updated patch still works great. Do not USE the files attached to this ticket, use the link that cdemyanovich posted.

Also to apply and test this I had to:

  - be on windows
  - open the patch in wordpad and resave it (line endings)
  - run the tests

To manually test this patch I did the following:

  - set SVN_ASP_DOT_NET_HACK=true
  - checked out an existing rails project i have
  - ruby script\plugin install -x http://form-test-helper.googlecode.com/svn/form_test_helper
  - ran "svn status" to make sure the plugin was correctly added as an external to SVN