I have some commits that I've decided, after the fact, are going to be more branch work then trunk work. How do I create the branch and revert the trunk while still ensuring merging isn't painful later?
Is it as simple as copying the current trunk to a branch and reverting the trunk? Or will this create headaches later?
To switch back, just provide the URL to the location in the repository from which you originally checked out your working copy: $ svn switch http://svn.red-bean.com/repos/trunk/vendors .
The trunk is the main line of development in a SVN repository. A branch is a side-line of development created to make larger, experimental or disrupting work without annoying users of the trunk version.
I think Philips method would be something like the following, assuming the last "good" revision was at 100 and you are now at 130, to create the new branch:
svn copy -r100 svn://repos/trunk svn://repos/branches/newbranch
svn merge -r 100:130 svn://repos/trunk svn://repos/branches/newbranch
Note the idea is to preserve the changes made in those revisions so you can apply them back to trunk.
To revert trunk:
svn merge -r130:100 .
svn ci -m 'reverting to r100 (undoing changes in r100-130)' .
(It wouldn't matter which order you performed these in, so you could revert trunk before creating the branch.)
Then you could switch to the new branch you created in the repo:
svn switch svn://repos/branches/newbranch workdir
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With