Rails app generator and Subversion

Is there any particular reason why

rails my_app --svn

shouldn't create the Rails structure and place it correctly under the
control of Subversion automatically?

If there isn't, am I ok to submit a patch that fixes it?

(P.S. the generator test code seems a bit thin on the ground. Have I
missed something, or is it unloved?)

Regards

NeilW

Neil,
The generator's are mostly unloved as far as tests go.

I believe the --svn flag could work, but only if the app you're
creating is in a directory of an already existing subversion repo.
That being said, I may not have added support for the rails generator
itself since I usually create a project and _then_ add it to the repo.

Kev

My idea is that

svnadmin create $HOME/repos/my_app
svn co file://$HOME/repos/my_app
rails my_app --svn

should be all you need to get Rails running under Subversion.

Including dealing with the volatile directories 'tmp' and 'log' - as
long as you've set 'global-ignores' properly in your
.subversion/config. It's actually this that breaks the current svn
support - even after the deliberate error in there has been fixed :wink:

I'll put the patches into Trac in a few hours.

Rgs

NeilW

Neil Wilson wrote:

My idea is that

svnadmin create $HOME/repos/my_app
svn co file://$HOME/repos/my_app
rails my_app --svn

should be all you need to get Rails running under Subversion.

Including dealing with the volatile directories 'tmp' and 'log' - as
long as you've set 'global-ignores' properly in your
.subversion/config. It's actually this that breaks the current svn
support - even after the deliberate error in there has been fixed :wink:

I'll put the patches into Trac in a few hours.

Some people use trunk/branches/tags structure for their svn setups.

Perhaps a rake task could be developed to run your svn startup tasks?

Nic

Agreed. Although trunk/branches/tags should be encouraged IMO,
everybody has there own way of doing things.

What if I want to create a repo in my local svk repository and mirror
it to a subversion repository somewhere? There are too many variables
that would make this an easy fit for the core. I agree that a Rake
task is the way to go - knock something up and then share it with the
world (bigbold.com/snippets is a good place for that). Its really
simple. As an example, here's a simple set of tasks I have for
dealing with new files and adding them to subversion:

http://pastie.caboo.se/18108

Cheers
Luke

I think you've missed my point. I'm not looking at putting subversion
repository commands in the core. I'm just trying to fix what is there,
ie make the 'svn add' in generator work correctly. Currently it is
broken.

Luke Redpath wrote:

That's fine. Create the repository as you like.

svn co $MY_REPOS/trunk my_app_blank_working_directory
rails --svn my_app_blank_working_directory.

All I'm suggesting is that if when you create the initial rails
structure via the generator it does the 'svn add' correctly. Just as it
does with model, scaffold, controller, etc.

NeilW

Dr Nic wrote:

Then do so.

All I want to see is that when you have a working copy directory
extracted from some Subversion repository (branch or otherwise), then
'rails --svn working_directory' works properly - by creating the file
structure and placing the manifest's files under the control of
Subversion.

The code is already in generator, and it already does this for Models,
controllers and scaffold. This is just a fix.

I presume you're happy that '--svn' exists in the rest of the
generator. Why not in the initial phase?

Luke Redpath wrote: