Comment 7 for bug 389413

Pieter Nagel (pieter-equinox) wrote :

This also happens to us in multiple scenarios:

------------
When we do a reverse merge to revert a specific change:

bzr merge -r4945..4944
Merging from remembered submit location bzr+ssh://pixar/devel/bzr/dante-head/
Merging from remembered submit location bzr+ssh://pixar/devel/bzr/dante-head/
bzr: ERROR: bzrlib.errors.ObjectNotLocked: _KnitGraphIndex(CombinedGraphIndex()) is not locked

Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 835, in exception_to_return_code
    return the_callable(*args, **kwargs)
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 1030, in run_bzr
    ret = run(*run_argv)
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 647, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/usr/lib/python2.5/site-packages/bzrlib/plugins/qbzr/lib/commands.py", line 671, in run
    return bzrlib.builtins.cmd_merge.run(self, *args, **kw)
  File "/usr/lib/python2.5/site-packages/bzrlib/builtins.py", line 3681, in run
    location, revision, remember, possible_transports, pb)
  File "/usr/lib/python2.5/site-packages/bzrlib/builtins.py", line 3795, in _get_merger_from_branch
    other_revision_id = revision[-1].as_revision_id(other_branch)
  File "/usr/lib/python2.5/site-packages/bzrlib/revisionspec.py", line 243, in as_revision_id
    return self._as_revision_id(context_branch)
  File "/usr/lib/python2.5/site-packages/bzrlib/revisionspec.py", line 387, in _as_revision_id
    branch, revno, revision_id = self._lookup(context_branch, None)
  File "/usr/lib/python2.5/site-packages/bzrlib/revisionspec.py", line 380, in _lookup
    revision_id = branch.get_rev_id(revno, revs_or_none)
  File "/usr/lib/python2.5/site-packages/bzrlib/remote.py", line 2317, in get_rev_id
    revno, last_revision_info)
  File "/usr/lib/python2.5/site-packages/bzrlib/remote.py", line 700, in get_rev_id_for_revno
    return self._get_rev_id_for_revno_vfs(revno, known_pair)
  File "/usr/lib/python2.5/site-packages/bzrlib/remote.py", line 688, in _get_rev_id_for_revno_vfs
    revno, known_pair)
  File "/usr/lib/python2.5/site-packages/bzrlib/repository.py", line 2427, in get_rev_id_for_revno
    self, partial_history, stop_index=distance_from_known)
  File "/usr/lib/python2.5/site-packages/bzrlib/repository.py", line 4549, in _iter_for_revno
    iterator.next()
  File "/usr/lib/python2.5/site-packages/bzrlib/repository.py", line 2457, in iter_reverse_revision_history
    parents = graph.get_parent_map([next_id])[next_id]
  File "/usr/lib/python2.5/site-packages/bzrlib/graph.py", line 167, in get_parent_map
    parent_map = self._get_parent_map(needed_revisions)
  File "/usr/lib/python2.5/site-packages/bzrlib/repository.py", line 2615, in get_parent_map
    self.revisions.get_parent_map(query_keys).iteritems():
  File "/usr/lib/python2.5/site-packages/bzrlib/knit.py", line 1200, in get_parent_map
    return self._get_parent_map_with_sources(keys)[0]
  File "/usr/lib/python2.5/site-packages/bzrlib/knit.py", line 1219, in _get_parent_map_with_sources
    new_result = source.get_parent_map(missing)
  File "/usr/lib/python2.5/site-packages/bzrlib/knit.py", line 3059, in get_parent_map
    self._check_read()
  File "/usr/lib/python2.5/site-packages/bzrlib/knit.py", line 2942, in _check_read
    raise errors.ObjectNotLocked(self)
ObjectNotLocked: _KnitGraphIndex(CombinedGraphIndex()) is not locked

---------

When we replay non-local changes:
bzr replay -r 4892 bzr+ssh://dante@pixar/devel/bzr/dante-head/
Password:
Password:
bzr: ERROR: bzrlib.errors.ObjectNotLocked: _KnitGraphIndex(CombinedGraphIndex()) is not locked

Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 835, in exception_to_return_code
    return the_callable(*args, **kwargs)
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 1030, in run_bzr
    ret = run(*run_argv)
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 647, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/usr/lib/python2.5/site-packages/bzrlib/plugins/rebase/__init__.py", line 320, in run
    todo = [revision[0].in_history(from_branch).rev_id]
  File "/usr/lib/python2.5/site-packages/bzrlib/revisionspec.py", line 225, in in_history
    return self._match_on_and_check(branch, revs)
  File "/usr/lib/python2.5/site-packages/bzrlib/revisionspec.py", line 204, in _match_on_and_check
    info = self._match_on(branch, revs)
  File "/usr/lib/python2.5/site-packages/bzrlib/revisionspec.py", line 320, in _match_on
    branch, revno, revision_id = self._lookup(branch, revs)
  File "/usr/lib/python2.5/site-packages/bzrlib/revisionspec.py", line 380, in _lookup
    revision_id = branch.get_rev_id(revno, revs_or_none)
  File "/usr/lib/python2.5/site-packages/bzrlib/remote.py", line 2317, in get_rev_id
    revno, last_revision_info)
  File "/usr/lib/python2.5/site-packages/bzrlib/remote.py", line 700, in get_rev_id_for_revno
    return self._get_rev_id_for_revno_vfs(revno, known_pair)
  File "/usr/lib/python2.5/site-packages/bzrlib/remote.py", line 688, in _get_rev_id_for_revno_vfs
    revno, known_pair)
  File "/usr/lib/python2.5/site-packages/bzrlib/repository.py", line 2427, in get_rev_id_for_revno
    self, partial_history, stop_index=distance_from_known)
  File "/usr/lib/python2.5/site-packages/bzrlib/repository.py", line 4549, in _iter_for_revno
    iterator.next()
  File "/usr/lib/python2.5/site-packages/bzrlib/repository.py", line 2457, in iter_reverse_revision_history
    parents = graph.get_parent_map([next_id])[next_id]
  File "/usr/lib/python2.5/site-packages/bzrlib/graph.py", line 167, in get_parent_map
    parent_map = self._get_parent_map(needed_revisions)
  File "/usr/lib/python2.5/site-packages/bzrlib/repository.py", line 2615, in get_parent_map
    self.revisions.get_parent_map(query_keys).iteritems():
  File "/usr/lib/python2.5/site-packages/bzrlib/knit.py", line 1200, in get_parent_map
    return self._get_parent_map_with_sources(keys)[0]
  File "/usr/lib/python2.5/site-packages/bzrlib/knit.py", line 1219, in _get_parent_map_with_sources
    new_result = source.get_parent_map(missing)
  File "/usr/lib/python2.5/site-packages/bzrlib/knit.py", line 3059, in get_parent_map
    self._check_read()
  File "/usr/lib/python2.5/site-packages/bzrlib/knit.py", line 2942, in _check_read
    raise errors.ObjectNotLocked(self)
ObjectNotLocked: _KnitGraphIndex(CombinedGraphIndex()) is not locked

---------

I've also seen this happening with bzr rebase, but I can't reproduce the exact scenario at the moment.