1 <?xml version="1.0" encoding="ISO-8859-1"?>
2 <!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
3 <!ENTITY % general-entities SYSTEM "../general.ent">
7 <sect1 id="ch03-merge">
8 <title>svn merge</title>
9 <?dbhtml filename="merge.html"?>
11 <para><userinput>svn merge</userinput>. This is useful to selectively apply changes
12 from one branch to other branches, or to trunk, or vice versa. This section is
13 only for people with write access to the LFS subversion server. It also assumes
14 you have a copy of the whole LFS repository.
17 <para>The syntax of the merge command is similar to the syntax of the diff
18 command, and additionally it supports a <emphasis>--dry-run</emphasis> flag to
19 show which will be updated. But, if a merge creates a conflict (e.g. a change
20 includes a date for the branch in general.ent which cannot be applied because the
21 branch name is different) you will get markers in the conflicted file, and a number
22 of versions of the files, but the only indication of the conflict is that
23 <userinput>svn st</userinput> will show some files not under version control.
26 <para>For example, revision 7476 corrected an incorrect comment in the text for
27 Man-DB and updated this in the changelog. I applied it to a branch by changing
28 to the root directory of the branch (that is, above BOOK/) and specifying
29 revision numbers of 7475:7476 in a command similar to this: (NB you will not
30 need your passphrase for this if you have an up to date local copy of the whole
34 <para><screen><userinput>svn merge --dry-run -r revision1:revision2 svn://svn.linuxfromscratch.org/LFS/trunk</userinput></screen></para>
36 <para>After I was sure this was going to update the correct files I ran it for
37 real. The merge command is not clever enough to notice that a change has already
38 been applied, so you must keep a note of which changes need to be applied. When
39 you commit merges, it is important to state which revisions are being merged in