Hi all,
A few weeks ago I started making a change in my SVN repository's trunk that I thought was going to be fairly minor.
After a few hours of work, realizing that the change had bigger implications than I thought, I decided it was too risky to check my changes into the trunk right away, so I made a branch, like this:
svn copy . https://my_svn_server/svn/blah/branches/my-branch
... and then did a svn switch and happily continued working in that branch. So far, so good, until I get to the point where I'm happy with all the changes and want to merge them back into the trunk again. So I check in all the changes into my-branch, and then carefully follow the procedure shown here ... and here is where I ran into trouble. Because I created my-branch from the local (client-side) repository that already had a large number of (not-checked-in) changes outstanding in it, the merge doesn't include the diffs corresponding to those changes, and thus there are lots and lots of conflicts in the merge that I have to resolve by hand -- something I don't want to do since it leaves room for bugs to creep in if I mess it up.
I tried including the missing diffs by decrementing the revision number I specify during the merge, e.g. by doing a
svn merge -r2818:2932 https://my_svn_server/svn/blah/branches/my-branch
instead of the expected
svn merge -r2819:2932 https://my_svn_server/svn/blah/branches/my-branch
...but that didn't work, because my-branch didn't exist at revision 2818, and so I just get an error:
svn: Unable to find repository location for 'https://my_svn_server/svn/blah/branches/my-branch' in revision 2818
So that's about where things stand. I can manually sort out the mess this time, but I'm curious if there is a way to handle this so that things go better for me next time.
One way I can think of would be to create my-branch not by copying the local (client-side) respository but rather by making a copy of the SVN trunk HEAD, and then checking out my-branch into a separate directory, and then manually copying my local (not-checked-in) changes from the trunk directory to the my-branch directory, and then reverting the local trunk directly... but that's pretty tedious and error-prone as well.
Surely there is a better, more automatic way to make a branch that contains local (not-checked-in) changes, and later merge it back into the trunk?