1 svn's merge command has three twisty little syntaxes, none
2 very DWIM-ish. For merging one file, apparently it is helpful
3 to specify that file itself. [This patch][] does that.
5 [This patch]: http://ikidev.betacantrips.com/patches/merge.patch
7 The bug that this fixes is hard to demonstrate without
8 generating a lot of noise, but you can get the idea by
9 finding a file that was committed in a subdirectory and
10 merging a change with it.
12 [apu]$ emacs one/test.mdwn
13 [apu]$ svn add one/test.mdwn
15 [apu]$ svn commit -m "Another test case for merging."
17 Transmitting file data .
18 Committed revision 42.
19 [apu]$ emacs one/test.mdwn
20 [apu]$ svn commit -m "Change."
22 Transmitting file data .
23 Committed revision 43.
24 svn merge -r38:39 ~/ikidevwc/patches/merge.patch
25 [apu]$ svn merge -r42:43 one/test.mdwn
26 svn: Cannot replace a directory from within
27 [apu]$ svn merge -r42:43 ~/ikidevwc/one/test.mdwn
28 svn: Cannot replace a directory from within`
30 CGI.pm does a command much like the last one. However:
32 [apu]$ svn merge -r43:42 ~/ikidevwc/one/test.mdwn
33 svn: Cannot replace a directory from within
34 [apu]$ svn merge -r43:42 ~/ikidevwc/one/test.mdwn ~/ikidevwc/one/test.mdwn
35 U /home/glasserc/ikidevwc/one/test.mdwn
37 In other words, merging works only when you specify
38 the file, or, alternately:
41 [apu]$ svn merge -r42:43 ~/ikidevwc/one/test.mdwn
44 ... if you're in the same directory as the file. Note that if
45 a file called "test.mdwn" happens to be where you are, it'll get
46 changed! I think this is what is meant in `svn help merge` when
49 If WCPATH is omitted, a default value of '.' is assumed, unless
50 the sources have identical basenames that match a file within '.':
51 in which case, the differences will be applied to that file.
53 So, to conclude: when merging two revisions of a file, either specify
54 the file, or be in the same directory as a file with the same name.
55 This patch makes the former always happen, whereas previously the
56 second would sometimes not happen. It also obviates the call to chdir.
58 Source: [this message][] on the svn-user list.
60 [this message]: http://svn.haxx.se/users/archive-2005-03/0926.shtml