[Svnmerge] Bugs when merging revisions that modify and deletefiles

Giovanni Bajo rasky at develer.com
Mon Feb 13 11:15:59 PST 2006


Alan Barrett <apb at cequrux.com> wrote:

>>>>         (a) modify a file in the trunk, and commit;
>>>>         (b) make any unrelated change anywhere, and commit;
>>>>         (c) delete the modified file in the trunk
>>>>
>>>> and then I try to merge both the modification (a) and the deletion
>>>> (c) in a single invocation of svnmerge.py, the file gets edited but
>>>> not deleted, and the file is not marked as being in a conflicted
>>>> state.  I attach a script to demonstrate this.
>
>> What is the "svn merge" command line that svnmerge produces? You can
>> use -vv to find out. If it's the correct one (that is, one that covers
>> both (a) and (c) in a single operation), then there is not much more
>> than svnmerge can do, and I'd suggest you to raise this problem on the
>> svn users mailing list.
>
> I don't see how svnmerge could ask svn to do it all in a single
> operation, since we want to merge revisions (a) and (c) without merging
> the intervening revision (b).

When you said that (b) is "make any unrelated change anywhere", I thought
you really meant "unrelated" as in "in other parts of the repository" (eg.
another branch). In that case, svnmerge is free to compact ranges.

> My script runs "svnmerge.py -r5,7".  svnmerge runs these two
> "svn merge" commands"
>
>     svn merge -r 4:5 file:///wherever/repo/trunk .
>     svn merge -r 6:7 file:///wherever/repo/trunk .
>
> The first "svn merge" command edits the file; this is merging
> item (a) from the earlier list.  The second "svn merge" command
> fails to delete the file, presumably because it sees that the
> working copy had been modified.
>
> svnmerge could, in theory, make this work by deleting the file itself
> after the second "svn merge", or by reverting the edits before the
> second "svn merge".  But doing that would require a lot more work, and
> may be outside the scope of what svnmerge is intended to do.


I don't think svnmerge should do much more than this, no. You might want to
check if "svn merge --force" helps here. In that case, I could be spoken
into adding "--force" to any svn merge operation (unless someone comes up
with a good reason for not doing it).
-- 
Giovanni Bajo




More information about the Svnmerge mailing list