I just received a mail from Walter McGinnis asking:

In other words start a new client project based on an existing open source project that is an entire rails application like Typo or Mephisto and be able to update, modify, and merge accordingly like you would for plugins with piston.

Walter proposed to use the following technique:

1 svn checkout repos_for_new_client_project new_client_project
2 cd new_client_project
3 piston import repos_for_third_party_open_source_rails_app_like_typo/trunk/app app
4 piston import repos_for_third_party_open_source_rails_app_like_typo/trunk/db db

This would work, but as Walter says:

… it doesn’t seem very DRY.

Since this isn’t the first time I am being asked the question, I decided to investigate a solution. I ended up with something that works just fine. The technique boils down to simply not creating trunk/ and using Piston to create that folder. You have to start from a fresh project to use this technique.

 1 $ piston version
 2 Piston 1.3.3
 3 
 4 $ svn checkout svn://my-server/project/ ~/project/
 5 Checked out revision 0.
 6 
 7 $ cd ~/project/
 8 
 9 $ piston import \
10     http://svn.techno-weenie.net/projects/mephisto/trunk/ \
11     trunk/
12 Exported r2856 from 'http://svn.techno-weenie.net/projects/mephisto/trunk/' to 'trunk/'
13 
14 $ svn commit --message "Imported Mephito trunk@2756"
15 
16 # Some time later...
17 $ cd ~/project/
18 $ piston update .
19 Processing '.'...
20   Fetching remote repository's latest revision and UUID
21   Restoring remote repository to known state at r2756
22   Updating remote repository to r2857
23   Processing adds/deletes
24   Removing temporary files / folders
25   Updating Piston properties
26   Updated to r2857 (56 changes)
27 $ svn commit --message "Updated Mephisto to r2857 (56 changes)"

If you use Piston to manage sub-directories (such as vendor/rails), everything will still work:

 1 $ svn update
 2 At revision 2.
 3 
 4 $ piston import http://dev.rubyonrails.org/svn/rails/trunk vendor/rails/
 5 Exported r6957 from 'http://dev.rubyonrails.org/svn/rails/trunk' to 'vendor/rails'
 6 
 7 $ svn commit --message "Imported Rails into vendor/rails at r6957"
 8 
 9 $ svn update
10 
11 $ piston update
12 Processing '.'...
13   Fetching remote repository's latest revision and UUID
14 unchanged from revision 2857
15 Processing 'vendor/rails'...
16 unchanged from revision 6957

Search

Your Host

A picture of me

I am François Beausoleil, a Ruby on Rails and Scala developer. During the day, I work on Seevibes, a platform to measure social interactions related to TV shows. At night, I am interested many things. Read my biography.

Top Tags

Books I read and recommend

Links

Projects I work on

Projects I worked on