daljian
daljian

Reputation: 102

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?

Upvotes: 0

Views: 617

Answers (2)

daljian
daljian

Reputation: 102

Following Commit only property changes on root of repo, not files I found that the below does the trick:

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

Upvotes: 0

Sameer Singh
Sameer Singh

Reputation: 1366

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.

Upvotes: 1

Related Questions