views:

152

answers:

2

Are there any tools available that will let me rebase in git style an SVN branch onto a new parent?

So, in the following situation, I create a feature branch, and there are commits to the trunk

              E---F---G  Feature
             /
A---B---C---D--H--I trunk

I'm looking for a tool which copies the trunk, and applies the commits one by one, letting me resolve any conflicts if any exist - but each commit retains the same commit message, and is still a separate commit.

                    E'---F'---G'  Feature
                   /
A---B---C---D--H--I trunk

So commit E' will be a commit with the same changes as E, except in the case of E causing a conflict, in which case E' will differ from E in that E' has the conflicts resolved, and the same commit message as E.

I'm looking for this as it helps in keeping branches up to date with trunk - the svnmerge.py / mergeinfo way does not help, as you still need to resolve your changes when you merge back to trunk.

+2  A: 

In order to keep a branch up to date with the changes in the trunk, you just merge the trunk into the branch using svn merge.

sbi
That workflow has a direct equivalent in Git, `git merge`. He's asking if there is an equivalent in Subversion to `git rebase`.
Ben James
Yes, that might well be so. And when working with git (I understand that git can even use an existing SVN repo) then that might indeed be the best to do. However, when working with SVN, the way to bring an existing SVN branch up to date with the latest changes in the trunk is to do what I wrote - which is why I wrote it that way.
sbi
@Ben I know there is not an equivalent in subversion, but I wondered if there were any 3rd party tools that effectively rebased
timmow
@sbi I'm not happy with the way merging changes from trunk works for us. We are stuck on a pre mergeinfo repository, and when you come to merge the branch back from trunk, you can still end up in conflict hell. A rebase as I described in my post would let you resolve the conflicts in a more manageable way than waiting until re integration.
timmow
@timmow Then you can merge your changes revision by revision copying the original commit message. But this would be a real pain.
Nikola Smiljanić
@sbi `git rebase` is not "the best to do" in Git. It is just one way to do it, Git is versatile. The question is asking if Subversion (which does not have that versatility) has any 3rd party tools to add such versatility. The answer is probably 'no'.
Ben James
+2  A: 

There is a rebase command in the sv utility for svn. I have never used it, because it creates a new branch.

js
SVN makes this hard. You could as a post step, Delete the pre-rebased branch and replace it with the rebased version. I assume svn would explode as soon as someone with local changes tried to update.
TK