Cannot push to svn. Setting append_revisions_only to False causes AssertionError (None already was parent for ...)

Bug #612611 reported by Patrick Noffke
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Bazaar Subversion Plugin
Fix Released
High
Jelmer Vernooij

Bug Description

I created a test script that does the following:

1. Create a svn repo.
2. Create a svn-import bzr repo of the svn repo.
3. Check out both svn and bzr copies of the respective branches.
4. Commit from svn.
5. Pull to bzr.
6. Commit from bzr.
7. Push to svn.
(Step 7 will fail unless you uncomment line 19 of the test script.)
8. Update svn.
9. Commit from svn.
10. Pull to bzr.
(Step 10 will fail if you do uncomment line 19 of the test script.)

If I don't set append_revisions_only to False, I get the error saying that I should. If I do set it to False, I get the backtrace below.

You can use the attached bash script to test. If you uncomment line 19, the script will append "append_revisions_only = False" to your ~/.bazaar/subversion.conf file. You need to do this to reproduce the error below.

Please let me know if I'm just doing something wrong. Thanks!

bzr: ERROR: exceptions.AssertionError: Tried registering <CachingRevisionMetadata for revision 1, path tree/trunk in repository '9b5be888-99a0-468a-bb1a-2b4e86a2de47'> as parent while None already was parent for <CachingRevisionMetadata for revision 3, path tree/trunk in repository '9b5be888-99a0-468a-bb1a-2b4e86a2de47'>

Traceback (most recent call last):
  File "/usr/lib64/python2.6/site-packages/bzrlib/commands.py", line 853, in exception_to_return_code
    return the_callable(*args, **kwargs)
  File "/usr/lib64/python2.6/site-packages/bzrlib/commands.py", line 1055, in run_bzr
    ret = run(*run_argv)
  File "/usr/lib64/python2.6/site-packages/bzrlib/commands.py", line 661, in run_argv_aliases
    return self.run_direct(**all_cmd_args)
  File "/usr/lib64/python2.6/site-packages/bzrlib/commands.py", line 665, in run_direct
    return self._operation.run_simple(*args, **kwargs)
  File "/usr/lib64/python2.6/site-packages/bzrlib/cleanup.py", line 122, in run_simple
    self.cleanups, self.func, *args, **kwargs)
  File "/usr/lib64/python2.6/site-packages/bzrlib/cleanup.py", line 156, in _do_with_cleanups
    result = func(*args, **kwargs)
  File "/usr/lib64/python2.6/site-packages/bzrlib/builtins.py", line 1013, in run
    possible_transports=possible_transports, local=local)
  File "/usr/lib64/python2.6/site-packages/bzrlib/decorators.py", line 194, in write_locked
    result = unbound(self, *args, **kwargs)
  File "/usr/lib64/python2.6/site-packages/bzrlib/workingtree.py", line 1614, in pull
    local=local)
  File "/usr/lib64/python2.6/site-packages/bzrlib/decorators.py", line 194, in write_locked
    result = unbound(self, *args, **kwargs)
  File "/usr/lib64/python2.6/site-packages/bzrlib/branch.py", line 962, in pull
    possible_transports=possible_transports, *args, **kwargs)
  File "/home/pnoffke/.bazaar/plugins/svn/branch.py", line 813, in pull
    stop_revision, overwrite, limit=limit)
  File "/home/pnoffke/.bazaar/plugins/svn/branch.py", line 736, in _update_revisions
    find_ghosts=False, pb=pb)
  File "/home/pnoffke/.bazaar/plugins/svn/fetch.py", line 1104, in find_until
    find_ghosts=find_ghosts, pb=pb))
  File "/home/pnoffke/.bazaar/plugins/svn/fetch.py", line 1060, in find_mainline
    branch_path, revnum, to_revnum=0, mapping=mapping):
  File "/home/pnoffke/.bazaar/plugins/svn/repository.py", line 807, in _iter_reverse_revmeta_mapping_history
    for revmeta in iter:
  File "/home/pnoffke/.bazaar/plugins/svn/util.py", line 165, in next
    return self.it()
  File "/home/pnoffke/.bazaar/plugins/svn/revmeta.py", line 983, in next
    ret = self._get_next()
  File "/home/pnoffke/.bazaar/plugins/svn/revmeta.py", line 1376, in convert
    metabranch._revs[-1]._set_direct_lhs_parent_revmeta(ret)
  File "/home/pnoffke/.bazaar/plugins/svn/revmeta.py", line 298, in _set_direct_lhs_parent_revmeta
    raise AssertionError("Tried registering %r as parent while %r already was parent for %r" % (parent_revmeta, self._direct_lhs_parent_revmeta, self))
AssertionError: Tried registering <CachingRevisionMetadata for revision 1, path tree/trunk in repository '9b5be888-99a0-468a-bb1a-2b4e86a2de47'> as parent while None already was parent for <CachingRevisionMetadata for revision 3, path tree/trunk in repository '9b5be888-99a0-468a-bb1a-2b4e86a2de47'>

bzr 2.1.2 on python 2.6.4 (Linux-2.6.33.6-147.fc13.x86_64-x86_64-with-fedora-13-Goddard)
arguments: ['/usr/bin/bzr', 'pull', 'file:///home/pnoffke/tmp/bzr-svn-test/bzrco/../svnrepo/tree/trunk']
encoding: 'UTF-8', fsenc: 'UTF-8', lang: 'en_US.UTF-8'
plugins:
  extmerge /home/pnoffke/.bazaar/plugins/extmerge [unknown]
  launchpad /usr/lib64/python2.6/site-packages/bzrlib/plugins/launchpad [2.1.2]
  netrc_credential_store /usr/lib64/python2.6/site-packages/bzrlib/plugins/netrc_credential_store [2.1.2]
  news_merge /usr/lib64/python2.6/site-packages/bzrlib/plugins/news_merge [2.1.2]
  qbzr /usr/lib/python2.6/site-packages/bzrlib/plugins/qbzr [0.19.0dev1]
  rewrite /home/pnoffke/.bazaar/plugins/rewrite [0.6.1dev]
  svn /home/pnoffke/.bazaar/plugins/svn [1.0.3]

*** Bazaar has encountered an internal error. This probably indicates a
    bug in Bazaar. You can help us fix it by filing a bug report at
        https://bugs.launchpad.net/bzr/+filebug
    including this traceback and a description of the problem.

Related branches

Revision history for this message
Patrick Noffke (patrick-noffke) wrote :
Revision history for this message
Jelmer Vernooij (jelmer) wrote :

Thanks *very* much for the detailed bug report.

Changed in bzr-svn:
status: New → Triaged
importance: Undecided → High
assignee: nobody → Jelmer Vernooij (jelmer)
Revision history for this message
Patrick Noffke (patrick-noffke) wrote :

You're welcome, Jelmer. Just curious, what is the expected behavior? Am I supposed to have to set append_revisions_only to False in this case? I don't know what that means when I do that -- is it going to mess up the svn history?

Here, the svn and bzr repo aren't diverging. I'm only changing in one and trying to push to the other. I don't see why the default behavior (append_revisions_only = True) shouldn't work.

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

This should now be fixed.

The operations you're doing require reordering of the commits on mainline, that's why that particular change to the configuration is necessary.

Changed in bzr-svn:
status: Triaged → Fix Committed
Revision history for this message
Patrick Noffke (patrick-noffke) wrote :
Download full text (7.7 KiB)

Hmm, doesn't seem to work. Now I'm getting this error:

bzr: ERROR: exceptions.AttributeError: 'module' object has no attribute 'NoColocatedBranchSupport'

I'm using bzr 2.1.2, and bzr-svn from launchpad (bzr branch lp:bzr-svn). I uncommented line 19 of the script. Here is the full output:

./bzrsvntest-bug-612611.sh
Adding tree/trunk
Adding tree/trunk/hello.txt
Adding tree/branches
Adding tree/tags

Committed revision 1.
Initialising Subversion metadata cache in /home/pnoffke/.bazaar/svn-cache/6646d2a4-f33a-413a-aed5-5390273c60ed.
Importing branches with prefix /tree/
Using repository layout: trunk1
Use 'bzr checkout' to create a working tree in the newly created branches.
Doing first commit from svn.
A svnco/hello.txt
Checked out revision 1.
Sending hello.txt
Transmitting file data .
Committed revision 2.
Doing bzr update.
Tree is up to date at revision 1 of branch /home/pnoffke/tmp/bzr-svn-test/bzrrepo/trunk
Doing bzr pull.
bzr: ERROR: exceptions.AttributeError: 'module' object has no attribute 'NoColocatedBranchSupport'

Traceback (most recent call last):
  File "/usr/lib64/python2.6/site-packages/bzrlib/commands.py", line 853, in exception_to_return_code
    return the_callable(*args, **kwargs)
  File "/usr/lib64/python2.6/site-packages/bzrlib/commands.py", line 1055, in run_bzr
    ret = run(*run_argv)
  File "/usr/lib64/python2.6/site-packages/bzrlib/commands.py", line 661, in run_argv_aliases
    return self.run_direct(**all_cmd_args)
  File "/usr/lib64/python2.6/site-packages/bzrlib/commands.py", line 665, in run_direct
    return self._operation.run_simple(*args, **kwargs)
  File "/usr/lib64/python2.6/site-packages/bzrlib/cleanup.py", line 122, in run_simple
    self.cleanups, self.func, *args, **kwargs)
  File "/usr/lib64/python2.6/site-packages/bzrlib/cleanup.py", line 156, in _do_with_cleanups
    result = func(*args, **kwargs)
  File "/usr/lib64/python2.6/site-packages/bzrlib/builtins.py", line 993, in run
    possible_transports=possible_transports)
  File "/usr/lib64/python2.6/site-packages/bzrlib/branch.py", line 170, in open
    return control.open_branch(_unsupported)
  File "/home/pnoffke/.bazaar/plugins/svn/remote.py", line 226, in open_branch
    raise errors.NoColocatedBranchSupport(self)
AttributeError: 'module' object has no attribute 'NoColocatedBranchSupport'

bzr 2.1.2 on python 2.6.4 (Linux-2.6.33.6-147.fc13.x86_64-x86_64-with-fedora-13-Goddard)
arguments: ['/usr/bin/bzr', 'pull', 'file:///home/pnoffke/tmp/bzr-svn-test/bzrco/../svnrepo/tree/trunk']
encoding: 'UTF-8', fsenc: 'UTF-8', lang: 'en_US.UTF-8'
plugins:
  extmerge /home/pnoffke/.bazaar/plu...

Read more...

Revision history for this message
Jelmer Vernooij (jelmer) wrote : Re: [Bug 612611] Re: Cannot push to svn. Setting append_revisions_only to False causes AssertionError (None already was parent for ...)

On Tue, 2010-08-10 at 14:27 +0000, Patrick Noffke wrote:
> Hmm, doesn't seem to work. Now I'm getting this error:
>
> bzr: ERROR: exceptions.AttributeError: 'module' object has no attribute
> 'NoColocatedBranchSupport'
>
> I'm using bzr 2.1.2, and bzr-svn from launchpad (bzr branch lp:bzr-svn).
> I uncommented line 19 of the script. Here is the full output:
It looks like I introduced a dependency on bzr 2.2. I've pushed a fix
for this that should reintroduce compatibility with bzr 2.1.2. Any
chance you can try again? r3394 of lp:bzr-svn

Cheers,

Jelmer

Revision history for this message
Patrick Noffke (patrick-noffke) wrote :

It works, thanks!

Jelmer Vernooij (jelmer)
Changed in bzr-svn:
milestone: none → 1.0.4
Jelmer Vernooij (jelmer)
Changed in bzr-svn:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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