
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
Copying Changes Between Branches
|
59
If you want changes applied somewhere else, you need to say so explicitly. For exam-
ple, if you’re sitting in the parent directory of your working copy, you have to spec-
ify the target directory to receive the changes:
$ svn merge -r 343:344 http://svn.example.com/repos/calc/trunk my-calc-branch
U my-calc-branch/integer.c
Best Practices for Merging
Merging changes sounds simple enough, but in practice it can become a headache.
The problem is that if you repeatedly merge changes from one branch to another,
you might accidentally merge the same change twice. When this happens, some-
times things will work fine. When patching a file, Subversion typically notices if the
file already has the change, and does nothing. But if the already existing change has
been modified in any way, you’ll get a conflict.
Ideally, your version control system should prevent the double application of
changes to a branch. It should automatically remember which changes a branch has
already received, and be able to list them for you. It should use this information to
help automate merges as much as possible.
Unfortunately, Subversion is not such a system. Like CVS, Subversion 1.0 does not
yet record any information about merge operations. When you commit local modifi-
cations, ...