
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
Common Use-Cases for Merging
|
61
the merge command to compare two unrelated trees. For example, you may have
imported two source-code trees representing different vendor releases of a software
project (see “Vendor Branches” in Chapter 7). If you asked
svn merge to compare the
two trees, you’d see the entire first tree being deleted, followed by an add of the
entire second tree!
In these situations, you’ll want
svn merge to do a path-based comparison only,
ignoring any relations between files and directories. Add the
--ignore-ancestry
option to your merge command, and it will behave just like svn diff. (And con-
versely, the
--notice-ancestry option will cause svn diff to behave like the merge
command.)
Common Use-Cases for Merging
There are many different uses for svn merge, and this section describes the most com-
mon scenarios.
Merging a Whole Branch to Another
To complete our running example, we’ll move forward in time. Suppose several days
have passed, and many changes have happened on both the trunk and your private
branch. Suppose that you’ve finished working on your private branch; the feature or
bug fix is finally complete, and now you want to merge all of your branch changes
back into the trunk for others to enjoy.
So how do we use
svn merge in this scenario? Remember that this command ...