views:

58

answers:

2

Let's say you work on a large project with multiple features targeted in each release. We may have different feature branches (in the VCS) for each feature development. But after all the feature branch is merged and integration is done say one of the feature is dropped (this happens more frequently in our organization than you would imagine). Is there a way to rollback a feature at this point? What we usually do is to figure out all the code changes and manually roll back. Do you have any processes/best practices that will help reduce this effort? For the record, we have a java project with subversion as the VCS.

+5  A: 

It depends why you dropped the feature.

If "at the last moment" is during system testing, and you don't want to repeat it, then I'd say that you just disable the feature and ship it anyway.

We have done this in the past; removing the feature can be too risky in terms of creating additional bugs. If you don't want the feature any more (for example, the requirement has gone away, or the implementation has been decided to be incorrect), then it is probably better in terms of risk to just switch it off with minimum code changes.

I mean, remove or hide UI elements which enable the feature, then users won't know it's there (provided it's turned off by default).

Hopefully during a future release there will be an opportunity to refactor that part of the code and either remove the feature or reintroduce it properly.

MarkR
Almost right (but still +1). Disable, *RE-TEST*, then ship.Disable with the minimum change necessary to disable the feature. In a GUI based system, this might be as simple as disabling, or removing, a menu item. In other systems, you need to figure out the minimum change ...
Mawg
Ok, you will still need to do some further system testing after the feature is disabled, mainly to check for regressions introduced by disabling the feature (e.g. did you accidentally disable some other feature) and to ensure that the feature really is disabled.
MarkR
+1  A: 

If you're using TortoiseSVN as a client, it has a "roll back changes from this revision" right in the context menu.

Simply show the log on the working copy, and choose the revision that you wish to reverse-merge (in the case, the revision that represents where you merged in the feature branch).

alt text

Otherwise, you can do a reverse merge from the command line. Reverse merging creates a new revision that is the HEAD revision minus the changes from the revision that you reverse-merged, so you can always "reverse reverse" merge. SVN is great that way.

womp