bzr keywords plugin crashed with NotImplementedError in inventory()

Bug #746289 reported by James Hunt
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar
Confirmed
Medium
Unassigned
Breezy
Fix Released
Medium
Jelmer Vernooij
bzr (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Binary package hint: bzr

Running, "bzr unshelve" or "bzr unshelve 1" caused a bzr failure:

___________________________

$ bzr unshelve 1
Using changes with id "1".
bzr: ERROR: exceptions.NotImplementedError: <property object at 0xa57aaa4>

Traceback (most recent call last):
  File "/usr/lib/python2.6/dist-packages/bzrlib/commands.py", line 912, in exception_to_return_code
    return the_callable(*args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/bzrlib/commands.py", line 1112, in run_bzr
    ret = run(*run_argv)
  File "/usr/lib/python2.6/dist-packages/bzrlib/commands.py", line 690, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/usr/lib/python2.6/dist-packages/bzrlib/commands.py", line 705, in run
    return self._operation.run_simple(*args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/bzrlib/cleanup.py", line 135, in run_simple
    self.cleanups, self.func, *args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/bzrlib/cleanup.py", line 165, in _do_with_cleanups
    result = func(*args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/bzrlib/builtins.py", line 5923, in run
    unshelver.run()
  File "/usr/lib/python2.6/dist-packages/bzrlib/shelf_ui.py", line 478, in run
    merger.do_merge()
  File "/usr/lib/python2.6/dist-packages/bzrlib/merge.py", line 704, in do_merge
    merge = operation.run_simple()
  File "/usr/lib/python2.6/dist-packages/bzrlib/cleanup.py", line 135, in run_simple
    self.cleanups, self.func, *args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/bzrlib/cleanup.py", line 165, in _do_with_cleanups
    result = func(*args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/bzrlib/merge.py", line 675, in _do_merge_to
    merge.do_merge()
  File "/usr/lib/python2.6/dist-packages/bzrlib/merge.py", line 814, in do_merge
    operation.run()
  File "/usr/lib/python2.6/dist-packages/bzrlib/cleanup.py", line 131, in run
    self.cleanups, self.func, self, *args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/bzrlib/cleanup.py", line 165, in _do_with_cleanups
    result = func(*args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/bzrlib/merge.py", line 819, in _do_merge
    self._compute_transform()
  File "/usr/lib/python2.6/dist-packages/bzrlib/merge.py", line 857, in _compute_transform
    file_status = self._do_merge_contents(file_id)
  File "/usr/lib/python2.6/dist-packages/bzrlib/merge.py", line 1369, in _do_merge_contents
    hook_status, lines = hook.merge_contents(params)
  File "/usr/lib/python2.6/dist-packages/bzrlib/merge.py", line 1453, in merge_contents
    return self._default_other_winner_merge(merge_hook_params)
  File "/usr/lib/python2.6/dist-packages/bzrlib/merge.py", line 1436, in _default_other_winner_merge
    filter_tree_path=filter_tree_path)
  File "/usr/lib/python2.6/dist-packages/bzrlib/transform.py", line 2570, in create_from_tree
    ContentFilterContext(filter_tree_path, tree))
  File "/usr/lib/python2.6/dist-packages/bzrlib/filters/__init__.py", line 170, in filtered_output_bytes
    chunks = filter.writer(chunks, context)
  File "/home/james/.bazaar/plugins/keywords/keywords.py", line 259, in _normal_kw_expander
    return _kw_expander(chunks, context)
  File "/home/james/.bazaar/plugins/keywords/keywords.py", line 254, in _kw_expander
    encoder=encoder)]
  File "/home/james/.bazaar/plugins/keywords/keywords.py", line 202, in expand_keywords
    expansion = expansion(context)
  File "/home/james/.bazaar/plugins/keywords/keywords.py", line 53, in <lambda>
    lambda c: c.revision_id())
  File "/usr/lib/python2.6/dist-packages/bzrlib/filters/__init__.py", line 115, in revision_id
    self._entry = self._tree.inventory[file_id]
  File "/usr/lib/python2.6/dist-packages/bzrlib/transform.py", line 1836, in inventory
    raise NotImplementedError(_PreviewTree.inventory)
NotImplementedError: <property object at 0xa57aaa4>

___________________________

Problem is caused by the keywords plugin (lp:bzr-keywords). I worked around this bug by doing the following:

  mv ~/.bazaar/plugins/keywords/ ~
  bzr unshelve 1
  mv ~/keywords ~/.bazaar/plugins/

ProblemType: Crash
DistroRelease: Ubuntu 10.10
Package: bzr 2.2.1-0ubuntu1
ProcVersionSignature: Ubuntu 2.6.35-28.49-generic-pae 2.6.35.11
Uname: Linux 2.6.35-28-generic-pae i686
NonfreeKernelModules: nvidia
Architecture: i386
BzrDebugFlags: set()
BzrVersion: 2.2.1
CommandLine: ['/usr/bin/bzr', 'unshelve', '1']
CrashDb: bzr
Date: Thu Mar 31 09:28:43 2011
ExecutablePath: /usr/bin/bzr
FileSystemEncoding: UTF-8
InstallationMedia: Ubuntu 10.10 "Maverick Meerkat" - Release i386 (20101007)
InterpreterPath: /usr/bin/python2.6
Locale: en_GB.utf8
Platform: Linux-2.6.35-28-generic-pae-i686-with-Ubuntu-10.10-maverick
ProcCmdline: /usr/bin/python /usr/bin/bzr unshelve 1
ProcEnviron:
 SHELL=/bin/bash
 PATH=(custom, user)
 LANG=en_GB.utf8
PythonVersion: 2.6.6
SourcePackage: bzr
Title: bzr crashed with NotImplementedError in inventory()
UserEncoding: UTF-8
UserGroups: adm admin cdrom dialout libvirtd lpadmin plugdev sambashare sbuild

Related branches

Revision history for this message
James Hunt (jamesodhunt) wrote :
visibility: private → public
Revision history for this message
James Hunt (jamesodhunt) wrote :

I'm not convinced this bug is a duplicate of bug 389674. Yes, I get the same stacktrace, but that other bug appears unrelated to bzr-keywords and there is no mention of the work-around I used (which appears to show the bug is with that plugin)?

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

Sorry, I was indeed a bit too quick to mark this as a dupe of that other bug.

To be able to expand $Revision-Id$ here we're looking at the text revision in the inventory, which is not set for preview trees. On the other hand, we can't use the Tree itself for this as the Tree interface doesn't have a way to retrieve the last changed revision. Perhaps it's time to extend it to do so ?

Changed in bzr:
status: New → Confirmed
importance: Undecided → Medium
tags: added: content-filtering inventory
removed: i386 maverick need-duplicate-check
Revision history for this message
Jelmer Vernooij (jelmer) wrote :

To clarify my last comment - such a new method should be optional or only be present on e.g. RevisionTree, as it's not possible for all trees/files to return a last changed revision.

Revision history for this message
John A Meinel (jameinel) wrote :

changing this to just be an "upstream" bug, rather than a bug in the particular ubuntu package.

Changed in bzr (Ubuntu):
status: New → Invalid
Jelmer Vernooij (jelmer)
tags: added: check-for-breezy
Jelmer Vernooij (jelmer)
affects: bzr → bzr-keywords
tags: removed: check-for-breezy
affects: bzr-keywords → bzr
Changed in brz:
status: New → Fix Released
Jelmer Vernooij (jelmer)
Changed in brz:
status: Fix Released → Triaged
importance: Undecided → Medium
assignee: nobody → Jelmer Vernooij (jelmer)
Jelmer Vernooij (jelmer)
Changed in brz:
status: Triaged → Fix Committed
milestone: none → 3.0.0
Jelmer Vernooij (jelmer)
Changed in brz:
status: Fix Committed → Fix Released
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.