Branching and Merging of PubMan subversion projects
Please Note: Page under development
Create branch[edit]
- Create new development branches in the affected repositories.
$ svn copy https://subversion.mpdl.mpg.de/repos/<repo>/trunk/<top-module> \ https://subversion.mpdl.mpg.de/repos/<repo>/branches/<name-of-new-branch>/<top-module> \ -m "Creating a branch of /<repo>/trunk/<top-module> for ..."
where <repo>={common,pubman,...}
, <top-module>={common_services,pubman,...}
.
- Checkout branches in new local working directory
$ mkdir path_to_escidoc_dir/branches/<name-of-new-branch> $ cd path_to_escidoc_dir/branches/<name-of-new-branch> $ svn co https://subversion.mpdl.mpg.de/repos/<repo>/branches/<name-of-new-branch>/<top-module>
Eclipse setup[edit]
Prerequisites[edit]
- subclipse plugin (1.6.10+)
- maven plugin (0.10.0+)
Create new eclipse workspace[edit]
- File->Switch Workspace->Other
- Add new name of workbench, e.g. "<path_to_eclipse_workspaces>/workspace_<name-of-new-branch>"
- Check
Copy Settings->Workbench Layout
Import eSciDoc top-modules[edit]
in created workspace as Maven Projects (is needed for SVN update of top-module and changes in <top-module>/pom.xml, etc.)
- File->Import->Existing Maven Projects->Next->Root Directory->Browse
- Select <top-module> folder in path_to_escidoc_dir/branches/<name-of-new-branch>/<top-module>
- Uncheck all sub-modules
- Press button "Finish"
- The top-modules can be added to the eclipse Working Set of Package Explorer, it can be named, e.g. "Top modules".
Import eSciDoc sub-modules[edit]
which will be changed as Maven Projects. Same procedure as top-module above
Workcycle[edit]
Switching between main trunk and development branch[edit]
Modules, which will not be changed can be switched to the main trunk. It ensures a recent state of the modules after svn update
- Right mouse button click on the module->Team->Switch to another Branch/Tag/Revision ...
- Select...->trunk/<top-module>/<module>->OK
As soon as a module is supposed to be changed, it should be switched to the branch
- Right mouse button click on the module->Team->Switch to another Branch/Tag/Revision ...
- Select...->branches/<name-of-the-new-branch>/<top-module>/<module>->OK
- Subversion url of the selected module can be checked in Properties->Subversion
You can work now on the branch and you need not be afraid to make any changes in main trunk
Merging[edit]
main trunk -> branch[edit]
is needed to replicate the changes in the main trunk to your branch. It can happen if development of your branch and main trunk goes parallel.
- check status of the branch with
- $ cd path_to_escidoc_dir/branches/<name-of-new-branch>/<top-module>
- $ svn status
- or in eclipse (Package Explorer subversion icons)
- commit changes in the branch, if changes have been done
- Right mouse button click on the module->Team->Merge->Merge a range of revisions->Button Next->Merge from: (Select trunk/<top-module>/<module>)
- Check radio button "Select revisions on next page"->Button Next
- Check all revisions in the list since the branch has been created.
- You can check the start revision of the branch in svn history of <top-module>
- Press Next Button
- Resolve merging conflicts if needed
- You can revert merge results with Right mouse button click on the module->Team->Revert
- commit changes to the branch
branch -> main trunk[edit]
is needed after complete implementation of the features in the branch.
- switch url of the branched module to the url of main trunc module.
- commit changes
Related links[edit]
Please add your comments: Talk:Subversion_Branching_and_Merging