Subversion: How to merge only specific revisions into trunk when multiple consecutive changes are made in a branch?

前端 未结 8 1867
孤街浪徒
孤街浪徒 2020-12-09 10:34

I have been using TortoiseSVN, svn, and subclipse and I think I understand the basics, but there\'s one thing that\'s been bugging me for a while: Merging introduces unwante

8条回答
  •  [愿得一人]
    2020-12-09 10:50

    I believe you are including the revisions you want correctly, but the merge algorithm is failing to find the place to insert the wanted change and so including the line above it also. Here are the same steps but with a different set of changes, and I believe it works as you expected originally:

    $ svnadmin create repo
    $ svn mkdir -m '' file://`pwd`/repo/trunk
    
    Committed revision 1.
    $ svn mkdir -m '' file://`pwd`/repo/branches
    
    Committed revision 2.
    $ svn co file://`pwd`/repo/trunk co.trunk
    Checked out revision 2.
    $ cat > co.trunk/test.txt << EOF
    > A
    > B
    > C
    > EOF
    $ svn add co.trunk/test.txt
    A         co.trunk/test.txt
    $ svn commit -m '' co.trunk
    Adding         co.trunk/test.txt
    Transmitting file data .
    Committed revision 3.
    $ svn copy -m '' file://`pwd`/repo/trunk file://`pwd`/repo/branches/testbr
    
    Committed revision 4.
    $ svn co file://`pwd`/repo/branches/testbr co.testbr
    A    co.testbr/test.txt
    Checked out revision 4.
    $ cat > co.testbr/test.txt << EOF
    > A
    > A1 unwanted
    > B
    > C
    > EOF
    $ svn commit -m '' co.testbr
    Sending        co.testbr/test.txt
    Transmitting file data .
    Committed revision 5.
    $ cat > co.testbr/test.txt << EOF
    > A
    > A1 unwanted
    > B
    > B1 wanted
    > C
    > EOF
    $ svn commit -m '' co.testbr
    Sending        co.testbr/test.txt
    Transmitting file data .
    Committed revision 6.
    $ svn merge -r 5:6 file://`pwd`/repo/branches/testbr co.trunk
    --- Merging r6 into 'co.trunk':
    U    co.trunk/test.txt
    $ cat co.trunk/test.txt
    A
    B
    B1 wanted
    C
    

提交回复
热议问题