Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PREV, BASE, or COMMITTED revision keywords are invalid for URL while reintegrating a branch

Tags:

merge

svn

I have branched my trunk (at a previous revision) and implemented/commited a new feature and implemented part of another feature locally to the branch. I now need to reintegrate the finished feature to the trunk.

I svn cp branches/completedfeature branches/uncompletedfeature to get the partially completed feature in its own branch. I then svn revert -R . everything in the first branch so it is up to date.

Now when I svn merge --reintegrate ../../branches/completedfeature from the trunk, I get this cryptic (to me) error:

PREV, BASE, or COMMITTED revision keywords are invalid for URL while reintegrating a branch

Both the trunk and the completed feature branch are up to date with no local changes. What is going on?

like image 279
Chris Avatar asked Aug 01 '12 19:08

Chris


2 Answers

I had this error.

Your question was almost the only google result (here is a description of the keywords).

I had a long branch with other branches merged into it... the patch process was going to be long and difficult. So despite that This section of the SVN redbood suggests that you should merge two working copies, i optimistically tried reintegrating from the URL and it worked!

cd myLocalTrunk
svn merge --reintegrate https://svn.blah.blah/blah/blah/branches/myBranch
svn ci -m "reintegrating myBranch into trunk"
like image 98
andrew lorien Avatar answered Nov 19 '22 13:11

andrew lorien


It looks like I branched it poorly/wrong. I haven't figured out how to fix this the right way, for anyone that is in this situation here is how I got my changes in to the trunk preserving most of the history of this short-lived branch:

Find all your files that changed diff -ur trunk branch. Make sure you look through the diff's as any changes in the trunk that are not in the branch will get reverted, so ignore those files or if there are changes in a file in both tree's make sure to edit the diff manually later.

Copy any new files with svn to preserve their history svn cp branch/path/file trunk/path/file

Now you just need the changes in the files that did not change. You cannot do a two source merge because (at least in svn 1.7 in cygwin) it will delete and then add the file, wiping out the history. The option I chose was to build/apply a patch and make a commit message about what happened.

There are much better places to learn about patching, but below is what I did. Keep in mind you will need to manually fix your merge issues if you have files that got changed in both tree's.

Build your patch with diff -u trunk/path/file branch/path/file >> patch.patch Do this for each file, or pass in the recursive flag again and have diff do the hard work.

Do a dry run to make sure the patch works and gets the right files patched patch -p0 --dry-run < patch.patch Then patch it patch -p0 < patch.patch

Then make sure the project builds and check it in.

Leaving this question open in hopes someone knows the real answer.

like image 30
Chris Avatar answered Nov 19 '22 15:11

Chris