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

Ticket #8439 (new enhancement)

Opened 1 year ago

Last modified 1 year ago

[PATCH] Generators support merging into existing files

Reported by: nicwilliams Assigned to: nicwilliams
Priority: normal Milestone: 2.x
Component: Railties Version: edge
Severity: normal Keywords: generator rails_generator merging
Cc: nicwilliams

Description

[Note: this is a placeholder for ongoing development for a solution]

Currently the rails_generator framework handles conflicts (where a file to be generated already exists) by providing two options: skip or override/force. You can also perform a diff on the two files, but you are then returned back to choose btw skip or override.

I propose to add a 3rd option: merging.

Merging work as it does for subversion merging. For conflicts it will create two new files, representing the original and the new version; and the working file will be marked up to show where the conflict exists, and displaying the two options.

When the rails_generator operation is complete it will display whether merged files where merged cleanly or whether there were conflicts that require the user's attention.

As a bonus, as per svn merging, this should show up the merge as a conflict for the svn operation "svn status".

Attachments

generator_merging.patch (4.5 kB) - added by nicwilliams on 05/23/07 22:15:00.
Patch to provide a 'm'erge option for conflicting files during the create process of any generator

Change History

05/23/07 22:15:00 changed by nicwilliams

  • attachment generator_merging.patch added.

Patch to provide a 'm'erge option for conflicting files during the create process of any generator

05/27/07 16:28:53 changed by josh

  • summary changed from [enhancement] Generators support merging into existing files to [PATCH] Generators support merging into existing files.

07/11/07 09:53:25 changed by nicwilliams

  • component changed from ActiveRecord to Railties.