use bazaar as merge tool for subversion

Asked by ike casteleyn

Hi,

I would like to know if it's possible to use bazaar as a mergetool for subversion (to have easier merges). In some speech about git, I heard that some use git as a mergetool for subversion and I was wondering if I could do this with bazaar too.

Our subversion repository
trunk
branches/feature1
branches/feature2
branches/bugfix

trunk is always stable (or should be, but due to subversion merge problems this is not always the case)

Basically my team should continue working with subversion for all normal work.
Merging is something only I do and I would be the only one using bazaar (I would not use bazaar to do regular commits, only merging).

Following are the things that I want to do
- Keep branches up to date with trunk
- Reintegrate a feature-branch with trunk (then removing the branch)
- Regularly reintegrate bugfix-branch with trunk (but not removing the branch, so syncing afterwards again with trunk should be possible -> in subversion you have to do record-only merges for this to work)
- Merge feature-branch1 into feature-branch2 (then remove feature-branch1)

I'm not sure if it is possible or how to do this?

Best regards,
Ike

Question information

Language:
English Edit question
Status:
Solved
For:
Bazaar Edit question
Assignee:
No assignee Edit question
Solved by:
Jelmer Vernooij
Solved:
Last query:
Last reply:
Revision history for this message
Ian Clatworthy (ian-clatworthy) said :
#1
Revision history for this message
Jelmer Vernooij (jelmer) said :
#2

Hi Ike,

On 03/09/10 21:53, ike casteleyn wrote:
> I would like to know if it's possible to use bazaar as a mergetool for subversion (to have easier merges). In some speech about git, I heard that some use git as a mergetool for subversion and I was wondering if I could do this with bazaar too.
>
> Our subversion repository
> trunk
> branches/feature1
> branches/feature2
> branches/bugfix
>
> trunk is always stable (or should be, but due to subversion merge problems this is not always the case)
>
> Basically my team should continue working with subversion for all normal work.
> Merging is something only I do and I would be the only one using bazaar (I would not use bazaar to do regular commits, only merging).
>
> Following are the things that I want to do
> - Keep branches up to date with trunk
> - Reintegrate a feature-branch with trunk (then removing the branch)
> - Regularly reintegrate bugfix-branch with trunk (but not removing the branch, so syncing afterwards again with trunk should be possible -> in subversion you have to do record-only merges for this to work)
> - Merge feature-branch1 into feature-branch2 (then remove feature-branch1)
>
> I'm not sure if it is possible or how to do this?
>
You should indeed be able to do this using bzr-svn. However, I'm not
sure how much benefits it has to do use just bzr-svn (or git-svn for
that matter) for merges. Subversion 1.5 and later also do proper merge
tracking so should be as smart as merging with a DVCS. What specifics
benefits are after ?

Cheers,

Jelmer

Revision history for this message
ike casteleyn (icasteleyn) said :
#3

Hello,

@Jelmer:
Indeed merging since svn1.5 has been better (since 1.6 even more so).
However following things are what happens in svn that I hope bzr won't have an issue with.
- Sometimes the merge tracking (svn:mergeinfo) hasn't been updated (only happened once and can be manually fixed by editing the property). This is not so bad, as it was a one time problem, but still you rely on this.
- Merging featurebranch1 to featurebranch2 is not that trivial under svn (if you have allready merged the trunk to both branches to keep them up to date). Normal workflow would be here is that one branch goes back to the trunk and then merge trunk to the other branch. But I don't want this since I need to have a stable trunk.
I have done this merge once between branches and there are a lot of conlicts (I actualy tried several ways until I had one with less conflicts). Due to the high number of conflicts I don't really want to do this anymore (unless I really have to, now I just go with the "normal" workflow (even though this means an usntable trunk))
- Sometimes I have to resolve conflicts I have done before (as if the wrong common ancestor of a file has been taken).
For instance.
branch1 merged into trunk
trunk merged into branch2
trunk merged into branch3 -> conflict on a file -> resolved
branch2 merged into trunk
trunk merged into branch3 -> conflict on same file (and same conflicts again).

@Ian:
I installed bazaar 2.1.0-2
I created a test subversion-repo svn://localhost/testrepo
I created a bazaar sharedrepo
Now I'm a litte lost.

I did the following (in the shared repo location)

bzr co svn://localhost/testrepo
This created a testrepo folder with everything in (trunk and branches). I don't know how to merge between trunk and branches

I also tried this (also in the shared repo location)
bzr co svn://localhost/testrepo/trunk
bzr co svn://localhost/testrepo/branches/feature1
Now I have to bzr repositories. I can merge between these two now.

However in the log of feature1, you see the graph that something has been merged (all revision are 1, 2 and 3 and the merge revision is 1.1.1)
If I update the testrepo (my first attempt). The loggraph shows everthing as a normal commit.

Is this normal?

Thanks,
Ike

Revision history for this message
Best Jelmer Vernooij (jelmer) said :
#4

On 03/11/10 00:04, ike casteleyn wrote:
> @Jelmer:
> Indeed merging since svn1.5 has been better (since 1.6 even more so).
> However following things are what happens in svn that I hope bzr won't have an issue with.
> - Sometimes the merge tracking (svn:mergeinfo) hasn't been updated (only happened once and can be manually fixed by editing the property). This is not so bad, as it was a one time problem, but still you rely on this.
> - Merging featurebranch1 to featurebranch2 is not that trivial under svn (if you have allready merged the trunk to both branches to keep them up to date). Normal workflow would be here is that one branch goes back to the trunk and then merge trunk to the other branch. But I don't want this since I need to have a stable trunk.
> I have done this merge once between branches and there are a lot of conlicts (I actualy tried several ways until I had one with less conflicts). Due to the high number of conflicts I don't really want to do this anymore (unless I really have to, now I just go with the "normal" workflow (even though this means an usntable trunk))
> - Sometimes I have to resolve conflicts I have done before (as if the wrong common ancestor of a file has been taken).
> For instance.
> branch1 merged into trunk
> trunk merged into branch2
> trunk merged into branch3 -> conflict on a file -> resolved
> branch2 merged into trunk
> trunk merged into branch3 -> conflict on same file (and same conflicts again).
>
Ok, fair enough. I think Bazaar + bzr-svn should help with that.
> @Ian:
> I installed bazaar 2.1.0-2
> I created a test subversion-repo svn://localhost/testrepo
> I created a bazaar sharedrepo
> Now I'm a litte lost.
>
> I did the following (in the shared repo location)
>
> bzr co svn://localhost/testrepo
> This created a testrepo folder with everything in (trunk and branches). I don't know how to merge between trunk and branches
>
> I also tried this (also in the shared repo location)
> bzr co svn://localhost/testrepo/trunk
> bzr co svn://localhost/testrepo/branches/feature1
>
Yep, that's the proper thing to do (checking out the individual
branches, rather than the top of the repository).
> Now I have to bzr repositories. I can merge between these two now.
>
> However in the log of feature1, you see the graph that something has been merged (all revision are 1, 2 and 3 and the merge revision is 1.1.1)
> If I update the testrepo (my first attempt). The loggraph shows everthing as a normal commit.
>
> Is this normal?
>
Yep, you should never have to "bzr co" testrepo itself - in fact, I
think bzr will even warn you if you try to do that.

Cheers,

Jelmer

Revision history for this message
ike casteleyn (icasteleyn) said :
#5

Thanks Jelmer Vernooij, that solved my question.

Revision history for this message
ike casteleyn (icasteleyn) said :
#6

Hi,

Thanks for the input.
I'm testing everything out now.

Best regards,
Ike