| View previous topic :: View next topic |
| Author |
Message |
kAlvaro

Joined: 27 Mar 2008 Posts: 46 Location: Spain
|
Posted: Wed Sep 10, 2008 5:54 am Post subject: --reintegrate |
|
|
I have the usual branches/tags/trunk structure under Subversion 1.5.2, handled with TortoiseSVN. I created a feature branch and I’ve been regularly porting changes from trunk. At this point, the feature is complete and all changes in trunk are ported into the branch.
Now I want to reintegrate the branch into trunk. Tortoise has a Reintegrate a branch tool which I suppose makes a merge with the --reintegrate option. But I get this error:
| Code: | Command: Reintegrate merge file:///C:/Repo/branches/feature-foo into C:\Working Copy\web
Error: Cannot reintegrate from 'file:///C:/Repo/branches/feature-foo' yet:
Error: Some revisions have been merged under it that have not been merged
Error: into the reintegration target; merge them first, then retry.
Finished!: |
Google points to this article:
http://blogs.open.collab.net/svn/2008/07/subversion-merg.html
… which suggest two solutions:
1.- Manually remove the subtree mergeinfo (svn propdel svn:mergeinfo FOO)
2.- Use the old 2-URL merge syntax
I can’t really understand the article, so I don’t know how to proceed. In solution #1 it’s not clear what FOO represents. And solution #2 seems to be in conflict with the Subversion book’s chapter about merge:
| Quote: | | Notice our use of the --reintegrate option this time around. The option is critical for reintegrating changes from a branch back into its original line of development—don't forget it! |
What should I do? _________________ Mi sitio sobre programación web: http://bits.demogracia.com/ |
|
| Back to top |
|
rms7326
Joined: 06 May 2008 Posts: 17
|
Posted: Thu Sep 11, 2008 10:12 pm Post subject: Re: --reintegrate |
|
|
Yes, this is particularly annoying. To remove the sub-tree merge info (which I have noticed is introduced when renames occur to files) do the following.
From the top of your versioned directory (cd into your versioned directory) execute the following command:
| Code: |
svn propget svn:mergeinfo --depth=infinity
|
You will notice a bunch of merge information for the top level directory "." and probably for other files. You only need to preserve the merge info for "."
Look for some path name followed by " - ". To the left of the " - " will be the file name containing the property "svn:mergeinfo". To the right of the " - " and below it (perhaps several lines) will be the merge information. You will want to remove the merge information for all files and directories listed except ".". One by one you can remove the merge information as follows:
| Code: |
svn propdel svn:mergeinfo file:///C:/Repos/branches/feature-foo/someFileWithRougeMergeInfo
|
After removing the merge information you can confirm that you have removed all of them by re-running the svn propget command above. Only "." should contain the merge info (i.e. you should only see one " - " entry followed by perhaps several lines of revision numbers). Be sure to leave the "." information alone as this is valuable. Finally, commit you changes with:
| Code: |
svn commit -m "Removed bogus merge information."
|
Hopefully you can re-integrate after that. I should mention that we (at work) have abandoned re-integrate merges and simply performed cherry pick merges until this problem is fixed by the Subversion folks so I don't have to keep doing this. |
|
| Back to top |
|
kAlvaro

Joined: 27 Mar 2008 Posts: 46 Location: Spain
|
Posted: Fri Sep 12, 2008 3:17 am Post subject: |
|
|
Thank you for your explanation, it's very clear. So, if I understood correctly, I must remove mergeinfo from my branch.
You're right, this Subversion feature seems to be quite broken. I'm considering to track merges manually again. Actually, I did it pretty fine in 1.4. The only step I'm worried about is moving the finished branch into trunk. Removing the trunk and moving the branch sounds tempting, but it surely breaks something. The last time I ran into this problem I did a regular merge, but I didn't cherry-pick, so I guess I applied twice the changes I had already ported from trunk. Yet nothing seems wrong in the resulting source code... _________________ Mi sitio sobre programación web: http://bits.demogracia.com/ |
|
| Back to top |
|
kAlvaro

Joined: 27 Mar 2008 Posts: 46 Location: Spain
|
Posted: Tue Sep 16, 2008 4:34 am Post subject: |
|
|
For the records, this is aproximately what I've done in the latest feature branch:
| Code: | cd "C:\Working Copy"
svn switch file:///C:/Repo/branches/feature-foo
svn propget svn:mergeinfo --depth=infinity |
Write down all paths except . and:
| Code: | svn propdel svn:mergeinfo "C:\Working Copy\path1"
svn propdel svn:mergeinfo "C:\Working Copy\path2"
svn propdel svn:mergeinfo "C:\Working Copy\path3"
.... |
The propdel subcommand has a --recursive switch; perhaps I could have used a single command but I didn't try.
| Code: | svn commit -m "Removed bogus mergeinfo prior to reintegration."
svn switch file:///C:/Repo/trunk
svn merge --reintegrate file:///C:/Repo/branches/feature-foo .
svn commit -m "[port] Reintegrate changes from /branches/feature-foo into trunk." |
_________________ Mi sitio sobre programación web: http://bits.demogracia.com/ |
|
| Back to top |
|
rms7326
Joined: 06 May 2008 Posts: 17
|
Posted: Thu Sep 18, 2008 12:13 am Post subject: |
|
|
| kAlvaro wrote: | Thank you for your explanation, it's very clear. So, if I understood correctly, I must remove mergeinfo from my branch.
You're right, this Subversion feature seems to be quite broken. I'm considering to track merges manually again. Actually, I did it pretty fine in 1.4. The only step I'm worried about is moving the finished branch into trunk. Removing the trunk and moving the branch sounds tempting, but it surely breaks something. The last time I ran into this problem I did a regular merge, but I didn't cherry-pick, so I guess I applied twice the changes I had already ported from trunk. Yet nothing seems wrong in the resulting source code... |
I wasn't suggesting that you remove all the merge information just the merge information that is below the root directory of your project. Keep the merge tracking information for the top-level folder. It is very valuable and makes tracking much easier. In Subversion 1.4 you had to write down in your commit comments which revisions you merged. With Subversion 1.5 the merge tracking does this for you. It just appears to also do sub-folder merge tracking when a file is renamed or moved. I have now got in the habit of removing all sub-tree merge information.
I would like a SVN developer tell me why they do this and if it is necessary why does it not work with re-integration merging. |
|
| Back to top |
|
kAlvaro

Joined: 27 Mar 2008 Posts: 46 Location: Spain
|
Posted: Thu Sep 18, 2008 3:08 am Post subject: |
|
|
That's what I meant with "all paths except .": all subdirectories of /branches/feature-foo, but not feature-foo itself. I hope I did it well!  _________________ Mi sitio sobre programación web: http://bits.demogracia.com/ |
|
| Back to top |
|
alexand
Joined: 05 Jun 2009 Posts: 1
|
Posted: Fri Jun 05, 2009 10:22 am Post subject: -- reintegrate |
|
|
I have got the same trouble with svn merge --reintagrate and the given solution allows to perform the merge correctly.
However, it is possible to use the simple command : svn merge urlofBranch urlofTrunk
instead of : svn merge --reintegrate to integrate a branch into trunk ?
(In fact, the other members of project on which I work, prefer not to have to modify things about the mergeinfo subtree.)
Are the two commands equivalent ? |
|
| Back to top |
|
|
View previous topic :: View next topic |