简体   繁体   中英

subversion (1.7) commit merged files, including mergeinfo but leave other modified files

After having merged some changes from one branch to another I have the following files modified

M      .
M      modifiedDueToMerge
M      modifiedByMe

I only want to commit what comes from the merge, in other words "modifiedByMe" should still be modified after my commit.

I was going to try using changelists, eg

svn changelist merged .
svn changelist merged modifiedDueToMerge

But it doesn't take the "." and when getting status from the changelist I see only the "modifiedByMe" file.

What is the recommended way to do a merge + commit without including already modified files in the target branch?

I would suggest checking out a second clean copy of your branch, conducting the merge there, and committing that. I am not sure how careful you were, but it is possible your merge might have affected files you modified first, and now contain changes from the merge, as well as from you. I would do a full Check for modifications and do a diff between your working copy version and the base version of every affected file, just to be sure.

You might be able to determine which files would have been modified by the merge using TortoiseSVN 's log and selecting the revision range, and then committing those specific files from your checkout. This isn't 100% accurate though so I would still do what I suggested above.

Finally, I think it is a bad idea to commit svn:mergeinfo on anything other than on the root of the branch. I have been bitten more times than I can count by mergeinfo on files and subfolders so I wrote a tool to strip the svn:mergeinfo from them before committing the merge. Please have a look at this answer on SO for details.

仅提交存储库根目录的属性更改之后,而不是提交文件更改之后我发现以下方法可以解决问题:

svn commit --depth empty -m "comment about the commit" . modifiedDueToMerge

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM