Bazaar Version Control System

Committing in dirstate tree with a merge and symlinks causes AssertionError

Reported by Matthew Paul Thomas on 2007-03-13
2
Affects Status Importance Assigned to Milestone
Bazaar
High
Marien Zwart

Bug Description

After merging a bundle into my tree, "bzr commit" produces an error:

bzr: ERROR: exceptions.AssertionError:

Traceback (most recent call last):
  File "/usr/lib/python2.4/site-packages/bzrlib/commands.py", line 650, in run_bzr_catch_errors
    return run_bzr(argv)
  File "/usr/lib/python2.4/site-packages/bzrlib/commands.py", line 612, in run_bzr
    ret = run(*run_argv)
  File "/usr/lib/python2.4/site-packages/bzrlib/commands.py", line 304, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/usr/lib/python2.4/site-packages/bzrlib/builtins.py", line 2109, in run
    reporter=reporter)
  File "/usr/lib/python2.4/site-packages/bzrlib/decorators.py", line 165, in write_locked
    return unbound(self, *args, **kwargs)
  File "/usr/lib/python2.4/site-packages/bzrlib/workingtree_4.py", line 238, in commit
    result = WorkingTree3.commit(self, message, revprops, *args, **kwargs)
  File "/usr/lib/python2.4/site-packages/bzrlib/decorators.py", line 165, in write_locked
    return unbound(self, *args, **kwargs)
  File "/usr/lib/python2.4/site-packages/bzrlib/mutabletree.py", line 158, in commit
    revprops=revprops, *args, **kwargs)
  File "/usr/lib/python2.4/site-packages/bzrlib/commit.py", line 319, in commit
    self._populate_new_inv()
  File "/usr/lib/python2.4/site-packages/bzrlib/commit.py", line 656, in _populate_new_inv
    path, self.work_tree)
  File "/usr/lib/python2.4/site-packages/bzrlib/repository.py", line 1977, in record_entry_contents
    self.repository.get_transaction())
  File "/usr/lib/python2.4/site-packages/bzrlib/inventory.py", line 208, in find_previous_heads
    assert candidates[ie.revision] == ie
AssertionError

bzr 0.15.0candidate0 on python 2.4.4.candidate.1 (linux2)
arguments: ['/usr/bin/bzr', 'commit', '-m', 'my commit message was here']

Steve Alexander (stevea) wrote :

I tried merging directly from the branch in question, not using a bundle. I can reproduce this error with the same version of Bazaar, but on a newer Python: bzr 0.15.0candidate0 on python 2.5.0.final.0 (linux2)

I have the branch available if someone at Canonical wants to debug it.

John A Meinel (jameinel) wrote :

This was reported and fixed. It is a small bug in our handling of symlinks in dirstate trees.
The fix is here:
http://bundlebuggy.aaronbentley.com/request/%<email address hidden>%3E

Which has already been merged into bzr.dev and will be present in 0.15rc2

Changed in bzr:
assignee: nobody → marienz
importance: Undecided → High
status: Unconfirmed → Fix Released
Steve Alexander (stevea) wrote :

At this point, the following expressions have the following values:
candidates[ie.revision]:

InventoryLink('mailconfigurenormal.zcml-20051031024101-91557621bcfb43e3', u'mail-configure-normal.zcml', parent_id='emperor-20051030145002-920a3c2f6ab83675', <email address hidden>')

ie:

InventoryLink('mailconfigurenormal.zcml-20051031024101-91557621bcfb43e3', 'mail-configure-normal.zcml', parent_id='emperor-20051030145002-920a3c2f6ab83675', <email address hidden>')

The only visible difference is that the second value is unicode in the first output, and a plain string in the second. But, they should compare equal.

I dug deeper, and altered the code to print out the state of candidates[ie.revision] and ie at this point, using the state that is compared in InventoryLink.__eq__ (actually InventoryEntry.__eq__).

The only difference was in text_size.

candidates[ie.revision].text_size is 0
ie.text_size is None

Steve Alexander (stevea) wrote :

Applying that patch to bzrlib/workingtree_4.py allows me to commit successfully.

Thanks.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers