bzr-svn: tracking svn merges

Jelmer Vernooij jelmer at samba.org
Fri Mar 4 21:54:11 UTC 2011


On Fri, 2011-03-04 at 15:44 -0500, Gordon Tyler wrote:
> Would it be possible for bzr-svn to track svn merges the same way bzr can
> track its own merges?
> 
> I'm working with a shared repo into which I've branched trunk and various
> branches of trunk from a svn 1.6 repo. Order of operations was something
> like this:
> 
> C:\dev\repo> bzr init-repo .
> C:\dev\repo> bzr branch http://svn/path/to/project/trunk trunk
> C:\dev\repo> bzr branch http://svn/path/to/project/branches/branch1
> branch1
> C:\dev\repo> bzr branch http://svn/path/to/project/branches/branch2
> branch2
> 
> bzr-svn can currently track when a branch is made. But if revisions from
> that branch are merged back into its parent that connection seems to be
> lost. In my example, branch1 was branched from trunk and branch2 was
> branched from branch1. branch1 has been merged back into trunk a few times
> and then branch2 was merged into trunk a few times. branch1 and branch2 are
> release branches, so they never had trunk merged into them.
> 
> I used bzr qlog in the root of the shared repo to see the branch lines and
> I can only see the branch operations. None of the branch lines indicate
> when they were merged.
> 
> Is this at all possible?
It's in theory possible but it's nontrivial, and I would argue that the
bulk of that work should be in Bazaar core:

The way merges are tracked in Subversion and Bazaar (and the other major
VCSes) is quite different.

Subversion merges are tracked on a per-changeset basis; svn:merge-info
contains the set of revisions that was merged into this one. If a
particular commit was "merged" then that means that its diff was applied
to the current branch. It doesn't say anything about its ancestors and
whether they were merged. In other words, merges are tracked as if they
are all cherrypicks.

Bazaar (and the other major VCSes) are DAG based and only track the
merge of revisions including their ancestry by adding them as parents to
the revision they're merged into. Bazaar supports cherrypick merging,
but it does not track which revisions were cherrypicked or infer the DAG
based on cherrypick data.

In theory it would be possible for bzr-svn to infer DAG data from the
svn mergeinfo property, but it would have some performance overhead. 
Supporting this would also require a bump of the bzr-svn mapping, as it
would change the way in which Bazaar revisions are created from
Subversion revisions (some revisions may get new parents and text
revisions may change as a consequence of that).  

As this sort of functionality would be useful too when Bazaar starts
supporting the tracking of cherrypick merges, I would argue that this
logic really should be in Bazaar.

When Bazaar itself starts supporting the tracking of cherrypick merging,
bzr-svn will be able to just import the cherrypick merge info from
Subversion and have Bazaar take care of possibly inferring any DAG
changes. This would also mean we don't have to do two bzr-svn mapping
bumps (one when bzr-svn adds this DAG inferring support, and once when
bzr starts supporting cherrypick merge tracking).

See bug 67174 about supporting cherrypick merge tracking in Bazaar.

Cheers,

Jelmer
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part
URL: <https://lists.ubuntu.com/archives/bazaar/attachments/20110304/7edbb0bd/attachment.pgp>


More information about the bazaar mailing list