different branches are using different ID mappings

Bug #332116 reported by nicholas a. evans
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Bazaar
Confirmed
Wishlist
Unassigned
Bazaar Subversion Plugin
Triaged
Low
Unassigned

Bug Description

== (nevans@nevans-laptop) [Fri Feb 20]-(10:48:39) ==
~/src/mdlogix/spice $ bzr branch svn+https://svn.mdlogix.com/plugins/spice/trunk
The svn+ syntax is deprecated, use https://svn.mdlogix.com/plugins/spice/trunk instead.
Branched 48 revision(s).
== (nevans@nevans-laptop) [Fri Feb 20]-(10:57:45) ==
~/src/mdlogix/spice $ bzr branch svn+https://svn.mdlogix.com/plugins/spice/branches/rails_2_2
The svn+ syntax is deprecated, use https://svn.mdlogix.com/plugins/spice/branches/rails_2_2 instead.
Branched 68 revision(s).
== (nevans@nevans-laptop) [Fri Feb 20]-(10:58:13) ==
~/src/mdlogix/spice $ bzr log --long --show-ids -r 47 trunk/
------------------------------------------------------------
revno: 47
revision-id: svn-v4:0487d25d-142b-0410-8fcf-b82ac621bf97:plugins/spice/trunk:49128
parent: svn-v4:0487d25d-142b-0410-8fcf-b82ac621bf97:plugins/spice/trunk:49127
svn revno: 49128 (on /plugins/spice/trunk)
committer: mdotterer
timestamp: Mon 2008-10-20 17:00:18 +0000
message:
  Re #11308
   Upgrading to Rails 2.1 for spice example app
== (nevans@nevans-laptop) [Fri Feb 20]-(10:58:35) ==
~/src/mdlogix/spice $ bzr log --long --show-ids -r 47 rails_2_2/
------------------------------------------------------------
revno: 47
revision-id: svn-v3-trunk2:0487d25d-142b-0410-8fcf-b82ac621bf97:plugins%2Fspice%2Ftrunk:49128
parent: svn-v3-trunk2:0487d25d-142b-0410-8fcf-b82ac621bf97:plugins%2Fspice%2Ftrunk:49127
svn revno: 49128 (on /plugins/spice/trunk)
committer: mdotterer
timestamp: Mon 2008-10-20 17:00:18 +0000
message:
  Re #11308
   Upgrading to Rails 2.1 for spice example app

This of course means that they aren't sharing any history (as far as bzr can tell), and so "missing" and "merge" (etc) give strange results.

Revision history for this message
Jelmer Vernooij (jelmer) wrote :

This is expected behaviour; see the file UPGRADING for details.

There isn't much that can be done about this until bzr has some sort of support for revision id aliases (either lazy or stored).

Changed in bzr-svn:
importance: Undecided → Low
status: New → Triaged
Revision history for this message
Jelmer Vernooij (jelmer) wrote :

Existing branches can be upgraded to the new mapping format by running "bzr svn-upgrade".

Jelmer Vernooij (jelmer)
Changed in bzr:
importance: Undecided → Wishlist
status: New → Triaged
Revision history for this message
nicholas a. evans (nevans) wrote :

Oh, I forgot to mention: I did run svn-upgrade. Over and over again. ;-) It still leaves me with the busted old mapping. Then I deleted the dir and started with a fresh branch, and I still have the busted old mapping. I'll run svn-upgrade again and attach the .bzr.log

Revision history for this message
nicholas a. evans (nevans) wrote :
Download full text (3.4 KiB)

Here is my .bzr.log after first running "branch" then "svn-upgrade". Maybe it will help?

this is a debug log for diagnosing/reporting problems in bzr
you can delete or truncate this file, or include sections in
bug reports to https://bugs.launchpad.net/bzr/+filebug

Fri 2009-02-20 12:05:56 -0500
0.028 bzr arguments: [u'branch', u'svn+https://svn.mdlogix.com/plugins/spice/branches/rails_2_2']
0.034 looking for plugins in /home/nevans/.bazaar/plugins
0.116 looking for plugins in /usr/lib/python2.5/site-packages/bzrlib/plugins
0.141 encoding stdout as sys.stdout encoding 'UTF-8'
[25082] 2009-02-20 12:05:57.521 WARNING: The svn+ syntax is deprecated, use https://svn.mdlogix.com/plugins/spice/branches/rails_2_2 instead.
0.602 opening SVN RA connection to 'https://svn.mdlogix.com/plugins/spice/branches/rails_2_2'
0.938 bzr-svn: using Subversion 1.5.1 ()
4.838 potential branching layouts: [('trunk1', 1220), ('root', 416), ('trunk4', 352), ('trunk2', 13)]
4.838 Guessed repository layout: TrunkLayout(1), guess layout to use: TrunkLayout(2)
10.177 unsupported file property 'svn:eol-style'
10.256 unsupported file property 'svn:eol-style'
10.835 creating branch <bzrlib.branch.BzrBranchFormat6 object at 0xa7a0aac> in file:///home/nevans/Private/mdlogix/spice/rails_2_2/.bzr/
160.963 created new branch BzrBranch6('file:///home/nevans/Private/mdlogix/spice/rails_2_2/')
160.995 trying to create missing lock '/home/nevans/Private/mdlogix/spice/rails_2_2/.bzr/checkout/dirstate'
160.996 opening working tree '/home/nevans/Private/mdlogix/spice/rails_2_2'
[25082] 2009-02-20 12:09:00.162 INFO: Branched 69 revision(s).
183.243 return code 0

Fri 2009-02-20 12:09:27 -0500
0.014 bzr arguments: [u'log', u'--long', u'--show-ids', u'-r', u'47', u'rails_2_2/']
0.019 looking for plugins in /home/nevans/.bazaar/plugins
0.103 looking for plugins in /usr/lib/python2.5/site-packages/bzrlib/plugins
0.126 encoding stdout as sys.stdout encoding 'UTF-8'
0.156 opening working tree '/home/nevans/Private/mdlogix/spice/rails_2_2'
0.237 return code 0

Fri 2009-02-20 12:09:45 -0500
0.018 bzr arguments: [u'svn-upgrade']
0.023 looking for plugins in /home/nevans/.bazaar/plugins
0.091 looking for plugins in /usr/lib/python2.5/site-packages/bzrlib/plugins
0.123 encoding stdout as sys.stdout encoding 'UTF-8'
0.226 opening working tree '/home/nevans/Private/mdlogix/spice/rails_2_2'
[25314] 2009-02-20 12:09:46.141 WARNING: The svn+ syntax is deprecated, use https://svn.mdlogix.com/plugins/spice/branches/rails_2_2 instead.
0.264 opening SVN RA connection to 'https://svn.mdlogix.com/plugins/spice/branches/rails_2_2'
0.545 bzr-svn: using Subversion 1.5.1 ()
2.143 potential branching layouts: [('trunk1', 1220), ('root', 416), ('trunk4', 352), ('trunk2', 13)]
2.143 Guessed repository layout: TrunkLayout(1), guess layout to use: TrunkLayout(2)
18.047 expand branches: [], ['branches', '*']
18.048 expand branches: ['branches'], ['*']
18.104 expand branches: [], ['trunk']
18.105 expand branches: ['trunk'], []
18.166 expand branches: [], ['tags', '*']
18.166 expand branches: ['tags'], ['*']
18.682 return code 0

Fri 2009-02-20 13:05:31 -0500
0.084 bzr arguments: ...

Read more...

Revision history for this message
Jelmer Vernooij (jelmer) wrote :

What is the latest revision in the newly created and the old branch? in particular, what are the revision ids?

What version of bzr-svn and bzr-rebase are you using exactly?

Revision history for this message
nicholas a. evans (nevans) wrote :
Download full text (11.9 KiB)

versions:
  lp:bzr-rebase revno 130 (0.4.4dev)
  lp:bzr-svn/0.5 revno 2612 (tag:bzr-svn-0.5.2)
  lp:subvertpy revno 2030 (subvertpy-0.6.4)

latest revisions:

== (nevans@nevans-laptop) [Fri Feb 20]-(21:53:01) ==
~/src/mdlogix/spice/trunk $ bzr log -r-1 -n1 --show-ids | grep rev
      svn revno: 53035 (on /plugins/spice/trunk)
      revision-id:svn-v4:0487d25d-142b-0410-8fcf-b82ac621bf97:plugins/spice/trunk:53035
== (nevans@nevans-laptop) [Fri Feb 20]-(21:53:09) ==
~/src/mdlogix/spice/trunk $ cd ../rails_2_2/
== (nevans@nevans-laptop) [Fri Feb 20]-(21:53:16) ==
~/src/mdlogix/spice/rails_2_2 $ bzr log -r-1 -n1 --show-ids | grep rev
      svn revno: 53310 (on /plugins/spice/branches/rails_2_2)
      revision-id:svn-v4:0487d25d-142b-0410-8fcf-b82ac621bf97:plugins/spice/branches/rails_2_2:53310

and the full revision id histories of both trunk and the rails_2_2 branch (after multiple runs of svn-upgrade, deleting the branch and rebranching, re-running svn-upgrade):

== (nevans@nevans-laptop) [Fri Feb 20]-(22:04:32) ==
~/src/mdlogix/spice/trunk $ bzr log --show-ids | grep revision-id
      revision-id:svn-v4:0487d25d-142b-0410-8fcf-b82ac621bf97:plugins/spice/trunk:53035
      revision-id:svn-v4:0487d25d-142b-0410-8fcf-b82ac621bf97:plugins/spice/trunk:49128
      revision-id:svn-v4:0487d25d-142b-0410-8fcf-b82ac621bf97:plugins/spice/trunk:49127
      revision-id:svn-v4:0487d25d-142b-0410-8fcf-b82ac621bf97:plugins/spice/trunk:49122
      revision-id:svn-v4:0487d25d-142b-0410-8fcf-b82ac621bf97:plugins/spice/trunk:49027
      revision-id:svn-v4:0487d25d-142b-0410-8fcf-b82ac621bf97:plugins/spice/trunk:47084
      revision-id:svn-v4:0487d25d-142b-0410-8fcf-b82ac621bf97:plugins/spice/trunk:47083
      revision-id:svn-v4:0487d25d-142b-0410-8fcf-b82ac621bf97:plugins/spice/trunk:46162
      revision-id:svn-v4:0487d25d-142b-0410-8fcf-b82ac621bf97:plugins/spice/trunk:46160
      revision-id:svn-v4:0487d25d-142b-0410-8fcf-b82ac621bf97:plugins/spice/trunk:46155
      revision-id:svn-v4:0487d25d-142b-0410-8fcf-b82ac621bf97:plugins/spice/trunk:42193
      revision-id:svn-v4:0487d25d-142b-0410-8fcf-b82ac621bf97:plugins/spice/trunk:42192
      revision-id:svn-v4:0487d25d-142b-0410-8fcf-b82ac621bf97:plugins/spice/trunk:42158
      revision-id:svn-v4:0487d25d-142b-0410-8fcf-b82ac621bf97:plugins/spice/trunk:42083
      revision-id:svn-v4:0487d25d-142b-0410-8fcf-b82ac621bf97:plugins/spice/trunk:41374
      revision-id:svn-v4:0487d25d-142b-0410-8fcf-b82ac621bf97:plugins/spice/trunk:41372
      revision-id:svn-v4:0487d25d-142b-0410-8fcf-b82ac621bf97:plugins/spice/trunk:41370
      revision-id:svn-v4:0487d25d-142b-0410-8fcf-b82ac621bf97:plugins/spice/trunk:41368
      revision-id:svn-v4:0487d25d-142b-0410-8fcf-b82ac621bf97:plugins/spice/trunk:41367
      revision-id:svn-v4:0487d25d-142b-0410-8fcf-b82ac621bf97:plugins/spice/trunk:40109
      revision-id:svn-v4:0487d25d-142b-0410-8fcf-b82ac621bf97:plugins/spice/trunk:32583
      revision-id:svn-v4:0487d25d-142b-0410-8fcf-b82ac621bf97:plugins/spice/trunk:32560
      revision-id:svn-v4:0487d25d-142b-0410-8fcf-b82ac621bf97:plugins/spice/trunk:31387
      revision-id:svn-v4:0487d25d-142b-0410-8fcf-b82ac621bf97:plugins/spi...

Revision history for this message
Jelmer Vernooij (jelmer) wrote :

ah, that's actually expected behaviour - it won't upgrade beyond round-tripped revisions.

In order to cope with this, we need knowledge of mappings in merge; i.e. a InterBranch.merge() function that can be overridden specifically for bzr-svn.

Revision history for this message
nicholas a. evans (nevans) wrote :

Is this because the parents of the round-tripped revisions have already been
recorded using the old mapping?

It does make it hard to merge from one branch to the other though. I suppose I
could just do a cherrypick merge or replay the revisions, but that feels so...
dirty. Also, when I tried both of those (merge, replay), they both gave
conflicts on everything. I assume this was because none of the files shared
the same IDs... ? Any suggestions?

A thought on svn-upgrade: when upgrading round-tripped revisions which have
ancestors with an old mapping, perhaps we should "convert" that round-tripped
revision to a "dumb" svn-mapped revision (albeit, perhaps with multiple
parents, and whatever other bzr props can still be ascertained from the old
round-tripped revision). So, for example, the top four revisions in the
rails_2_2 branch would change from:

svn-v4:0487d25d-142b-0410-8fcf-b82ac621bf97:plugins/spice/branches/rails_2_2:53310
<email address hidden>
<email address hidden>
svn-v3-trunk2:0487d25d-142b-0410-8fcf-b82ac621bf97:plugins%2Fspice%2Fbranches%2Frails_2_2:50561

to:

svn-v4:0487d25d-142b-0410-8fcf-b82ac621bf97:plugins/spice/branches/rails_2_2:53310
svn-v4:0487d25d-142b-0410-8fcf-b82ac621bf97:plugins/spice/branches/rails_2_2:50573
svn-v4:0487d25d-142b-0410-8fcf-b82ac621bf97:plugins/spice/branches/rails_2_2:50563
svn-v4:0487d25d-142b-0410-8fcf-b82ac621bf97:plugins/spice/branches/rails_2_2:50561

Then (I assume) there might not need to be another core bzr change to
facilitate this. What do you think? Is that possible or worthwhile?

Thanks!

Revision history for this message
nicholas a. evans (nevans) wrote :

It occurs to me that my suggestion wouldn't work as-is simply because the repo already has that first revision recorded with one parent, and you can't go and change the parent. so you'd need to go and define a new mapping, just to support the new semantics for svn-upgrade (which would force everyone to run svn-upgrade again).

In which case, what you've suggested probably makes more sense as a long term solution. If I understand you correctly, it might even remove the need for running svn-upgrade altogether?

Revision history for this message
Jelmer Vernooij (jelmer) wrote :

yes, that would indeed remove the need for svn-upgrade.

you should be able to "downgrade" the trunk to v3 by pulling from svn and specifying an explicit older mapping revision id:

$ bzr pull -rrevid:svn-v3-trunk2:0487d25d-142b-0410-8fcf-b82ac621bf97:plugins%2Fspice%2Ftrunk:53035

I'm not sure if this actually helps reduce conflicts though.

doing a "dumb" conversion of existing round-tripped revisions won't help, since that means breaking referential integrity. bzr revids need to always point at the exact same revision; changing one of the revision parents breaks that: the parent of the tip would be changed from <email address hidden> to svn-v4:0487d25d-142b-0410-8fcf-b82ac621bf97:plugins/spice/branches/rails_2_2:50573.

to summarize: I agree this is a bit of a pain, but there was really no way the mapping upgrade given the limitations we had in bzr-svn 0.4.x. It'll be a while before there will be another mapping upgrade, and we should make sure we have the right support in place in merge/pull/push by then that you won't even notice.

Revision history for this message
nicholas a. evans (nevans) wrote : Re: [Bug 332116] Re: different branches are using different ID mappings

On Sat, Feb 21, 2009 at 12:11 AM, Jelmer Vernooij <email address hidden> wrote:
> you should be able to "downgrade" the trunk to v3 by pulling from svn
> and specifying an explicit older mapping revision id:
>
> $ bzr pull -rrevid:svn-v3-trunk2:0487d25d-142b-0410-8fcf-
> b82ac621bf97:plugins%2Fspice%2Ftrunk:53035

Wonderful. That made the merging between trunk and the branch work
just fine. And after committing that merge (with a svn-v3 parent
revid), everything works as expected... until I tried to push trunk to
svn:

~/src/mdlogix/spice/trunk $ bzr push :parent
The svn+ syntax is deprecated, use
https://svn.mdlogix.com/plugins/spice/trunk instead.
bzr: ERROR: These branches have diverged. Try using "merge" and then "push".

Because the svn repo is "using" the v4 mapping now. Perhaps I could
temporarily downgrade to a version of bzr-svn 0.4.x in order to make
this commit? Oh well... I'm not going to do that. I'll just "svn rm
https://svn.mdlogix.com/plugins/spice/trunk && svn copy
https://svn.mdlogix.com/plugins/spice/{,branches/rails_2_2,trunk}".

Thanks for the help.

--
Nick

Revision history for this message
Jelmer Vernooij (jelmer) wrote : Re: [Bug 332116] Re: different branches are using different ID mappings

On Mon, Feb 23, 2009 at 01:16:58AM -0000, nicholas a. evans wrote:
> On Sat, Feb 21, 2009 at 12:11 AM, Jelmer Vernooij <email address hidden> wrote:
> > you should be able to "downgrade" the trunk to v3 by pulling from svn
> > and specifying an explicit older mapping revision id:

> > $ bzr pull -rrevid:svn-v3-trunk2:0487d25d-142b-0410-8fcf-
> > b82ac621bf97:plugins%2Fspice%2Ftrunk:53035

> Wonderful. That made the merging between trunk and the branch work
> just fine. And after committing that merge (with a svn-v3 parent
> revid), everything works as expected... until I tried to push trunk to
> svn:

> ~/src/mdlogix/spice/trunk $ bzr push :parent
> The svn+ syntax is deprecated, use
> https://svn.mdlogix.com/plugins/spice/trunk instead.
> bzr: ERROR: These branches have diverged. Try using "merge" and then "push".

> Because the svn repo is "using" the v4 mapping now. Perhaps I could
> temporarily downgrade to a version of bzr-svn 0.4.x in order to make
> this commit? Oh well... I'm not going to do that. I'll just "svn rm
> https://svn.mdlogix.com/plugins/spice/trunk && svn copy
> https://svn.mdlogix.com/plugins/spice/{,branches/rails_2_2,trunk}".

See the UPGRADING file in the bzr-svn source tarball; you can set the
mapping that bzr-svn will use for bzr-svn branches by default.

Once InterBranch.push() lands, bzr-svn should also Do The Right Thing
in this situation.

Cheers,

Jelmer

Jelmer Vernooij (jelmer)
Changed in bzr-svn:
milestone: none → 1.1.0
Martin Pool (mbp)
Changed in bzr:
status: Triaged → Confirmed
Jelmer Vernooij (jelmer)
Changed in bzr-svn:
milestone: 1.1.0 → 1.1.1
Jelmer Vernooij (jelmer)
tags: added: check-for-breezy
Jelmer Vernooij (jelmer)
no longer affects: brz
tags: removed: check-for-breezy
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.