Partial Commits with Subversion

前端 未结 11 1106
北恋
北恋 2020-11-29 17:36

Given the case I made two independent changes in one file: eg. added a new method and changed another method.

I often don\'t want to commit

11条回答
  •  情歌与酒
    2020-11-29 18:11

    Try using svn diff > out.patch then copy the out.patch file to out.patch.add and out.patch.modify

    Only when you have a working patch file revert the original file using svn revert out.c.

    Edit the patch files by hand so that they only contain the hunks for adding or modifying. Apply them to the original file using the patch command, test if the addition worked, then svn commit the addition.

    Wash rinse repeat for the out.patch.modify patch.

    If the changes are separate in the file as your initial question stated - added a new method, changed an existing method - this will work

    This is a very tedious solution - although I'm not convinced you should have any reason to separate your commits.

    You also could have checked out multiple working copies of the same source to apply your work against:

    svn co http://location/repository methodAdd

    svn co http://location/repository methodModify

    Be sure to svn up and test to make sure all is well.

提交回复
热议问题