Anda di halaman 1dari 4

How to maintain Subversion feature branches using IntelliJ IDEA 9.0.

3
For feature branch, you will usually need two merge operations.
First, you will periodically take changes from trunk. Second, after the feature is verified and ready for use, you will need to
deliver changes to trunk.
To take changes from trunk,
- Go to new Subversion Working Copies information in Changes toolwindow
- Click Merge from
- Select trunk in branch selector popup

In case your working copy format does not support svn:mergeinfo (earlier that 1.5), merge from trunk will start
immediately (svn merge <trunk-url> <working-copy-path>)

If your working copy format is 1.5 or newer, and merge information can be gathered, you will be prompted:

In case you want to check everything thoroughly, a dialog with not merged revisions is shown, where you can
browse changes and/or exclude some of them from merge: (see Merge information gathering rules)

1|Page

If you have any local changes that can accidentally intersect merged changes, you will be prompted about that
with following options:

Local changes can be automatically shelved, you can ignore warning, or choose to inspect local changes before
the merge.
Intersecting changes will be shown in Version Control toolwindow if you have selected inspect changes (only
for the case when youre merging a fixed subset of revisions.)

You will be prompted to resolve text conflicts if any would occur


Merge can be unsuccessful due to different reasons (unresolved conflicts, unversioned obstructions, missing files)

If merge is successful, commit dialog is shown with preset commit message containing information about merge
source, and preselected merged changes

2|Page

In Version Control toolwindow, merged files tree will be shown:

All merged changes are put into a new separate changelist, so you will be able to deal with conflicts or commit
changes later

To merge branch changes back into trunk, you should open trunk working copy and do same steps as when taking
changes from trunk into branch (selecting source branch in popup). Additionally, you will be warned:

Merge information gathering rules


To be able to merge changes back to trunk in a bunch (using Subversion --reintegrate), you should NOT have any
merges done on other target that working copy root, i.e. you should not have any svn:mergeinfo properties set in
working copy subtree.
Thats why when checking what revisions are merge, by default, IntelliJ IDEA would not check merge information in a
subtree.
But if you somewhy need subtree to be checked, you should go to Settings | Version Control | VCSs | Subversion
and set Check svn:mergeinfo in target subtree when preparing for merge.
3|Page

You can find detailed information about Subversion merge here:


http://svnbook.red-bean.com/nightly/en/svn-book.html#svn.branchmerge
http://blogs.open.collab.net/svn/2008/07/subversion-merg.html

4|Page

Anda mungkin juga menyukai