Rails app generator and Subversion

1 view
Skip to first unread message

Neil Wilson

unread,
Oct 16, 2006, 7:56:25 AM10/16/06
to Ruby on Rails: Core
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

Kevin Clark

unread,
Oct 16, 2006, 11:05:47 AM10/16/06
to rubyonra...@googlegroups.com
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


--
Kevin Clark
http://glu.ttono.us

Neil Wilson

unread,
Oct 16, 2006, 11:34:55 AM10/16/06
to Ruby on Rails: Core
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 ;-)

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

Rgs

NeilW

Dr Nic

unread,
Oct 17, 2006, 7:01:36 AM10/17/06
to Ruby on Rails: Core

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

Luke Redpath

unread,
Oct 17, 2006, 7:09:56 AM10/17/06
to rubyonra...@googlegroups.com
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

Neil Wilson

unread,
Oct 17, 2006, 9:10:46 AM10/17/06
to Ruby on Rails: Core
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.

Neil Wilson

unread,
Oct 17, 2006, 9:14:08 AM10/17/06
to Ruby on Rails: Core

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

Neil Wilson

unread,
Oct 17, 2006, 9:26:15 AM10/17/06
to Ruby on Rails: Core
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?

Reply all
Reply to author
Forward
0 new messages