Reverting tagged version back to trunk in subversion using Eclipse (Subclipse)
Yesterday I was given a new assignment. Of a certain system all development was stopped a month ago. The latest version, deployed and tested on the test environment, will not continue to be deployed on the production environment. The current version running on production is almost a year old. All new functionality developed after this version will be withdrawn, except for two changes. The assignment is to implement only these two changes on the version current running in production.
All the Java code is nicely stored in subversion. There is a tag of the version current running on the production environment, as well as several tags of later versions which has not been deployed to production, only to the test environment. And the trunk is the latest developemnt code, as it should be. How are we going to this, so the trunk can be used in future to contitue development?
My first thought was to create a branch and continue development with this branch. But this leaves us with a trunk that will not be used any more. Not nice and quite confusing for further development and maintenance. For a nice situation we have to move the trunk back to a tagged version or to a branch.
Searching with Google, all I could find was information to merge a branch with the trunk. But that would result in lots of merging conflicts, because lots of changes were made after the tagged ‘production’ version. A path I didn’t want to go to. There must be an easier way.
The available tools are also a part of the problem. I can only use the subversion plug-in in Eclipse, Subclipse, because it’s not allowed to install software on your own (policy by the company where I was hired). So no Tortoise .
The solution I’ve finally chosen is to go to the subversion perspective in Eclipse and to retrieve the history of the tagged version which is currently in production. Then note the revision number of the latest code change of this tag (excluding the revision of the tagging itself).
Then in the normal Java perspective checkout the trunk of the project in your workspace and retrieve the history of the trunk. You might need to press the "Get All" button to retrieve the full history. Find the revision number you noted and select all later revisions (select the revision right after your noted revision -one above- and while shift-pressed select the latest revision -the first one on top of the list).
With the alternate menu (right mouse click on the selection) you select option "Revert Changes from Revision x to Revision y". The reversion will only be applied to your local workspace.
By comparing your local workspace with the tagged version (right mouse click on the project – Compare With – Branch/Tag – select tagged version from repository), you can verify if the reversion was successful.
Finally Synchronise and commit all changes.
Now I am still wondering…. Is there an easier way to do it?
(also solutions using Tortoise are welcome)
- The AMIS Summary of Oracle OpenWorld 2013 is available for download – 60-page white paper
- On the integrity of data in Java applications – presentation from JFall 2013
- Book Review of Building Modular Cloud Apps with OSGi by Bert Ertman and Paul Bakker (last edit: 25th October)
- Java 8 – Collection enhancements leveraging Lambda Expressions – or: How Java emulates SQL
- OOW13: summarizing one week and 2000 sessions in 3 hours and a bit – the yearly AMIS OOW Review session – 10th October
- JavaOne 2013: (Key) Notes of a conference – State of the Java platform and all the roadmaps
- OOW13 and JavaOne 13: Notes from a Conference – Part Two
- OOW13 and JavaOne 13: Notes from a Conference – Part One
- Getting started with Java EE 7 – Hands on in 10 minutes
- Automatic deployment .ear file to Oracle Application Server 10.1.3 (OAS) with Ant tasks