Starting Bazaar explorer the 1st time: GitWorkingTree.inventory AttributeError

Bug #922121 reported by Péter Szabó
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
QBzr
Fix Released
Medium
Jelmer Vernooij

Bug Description

win7-64

bzr: ERROR: exceptions.AttributeError: 'GitWorkingTree' object has no attribute 'inventory'

Traceback (most recent call last):
  File "C:/Program Files (x86)/Bazaar/plugins\explorer\lib\explorer.py", line 1514, in callable_with_cleanup
  File "C:/Program Files (x86)/Bazaar/plugins\explorer\lib\explorer.py", line 1682, in _open_location_task
  File "C:/Program Files (x86)/Bazaar/plugins\explorer\lib\explorer.py", line 683, in changed_view
  File "C:/Program Files (x86)/Bazaar/plugins\explorer\lib\wt_browser.py", line 66, in set_tree
  File "C:/Program Files (x86)/Bazaar/plugins\explorer\lib\wt_browser.py", line 470, in set_tree
  File "C:/Program Files (x86)/Bazaar/plugins\explorer\lib\wt_browser.py", line 636, in set_tree
  File "C:/Program Files (x86)/Bazaar/plugins\qbzr\lib\treewidget.py", line 1462, in set_tree
  File "C:/Program Files (x86)/Bazaar/plugins\qbzr\lib\treewidget.py", line 539, in set_tree
  File "C:/Program Files (x86)/Bazaar/plugins\qbzr\lib\treewidget.py", line 649, in process_inventory
AttributeError: 'GitWorkingTree' object has no attribute 'inventory'

bzr 2.5b5 on python 2.6.6 (win32)
arguments: ['C:\\Program Files (x86)\\Bazaar\\tbzrcommand.exe', '--command=explorer', '--dir=D:\\as-git-repo']
encoding: 'cp1250', fsenc: 'mbcs', lang: None
plugins:
  bzrtools C:\Program Files (x86)\Bazaar\plugins\bzrtools [2.5.0]
  changelog_merge C:\Program Files (x86)\Bazaar\plugins\changelog_merge [2.5b5]
  colo C:\Program Files (x86)\Bazaar\plugins\colo [0.3.1dev]
  explorer C:\Program Files (x86)\Bazaar\plugins\explorer [1.2.1]
  fastimport C:\Program Files (x86)\Bazaar\plugins\fastimport [0.12.0dev]
  git C:\Program Files (x86)\Bazaar\plugins\git [0.6.6]
  launchpad C:\Program Files (x86)\Bazaar\plugins\launchpad [2.5b5]
  loom C:\Program Files (x86)\Bazaar\plugins\loom [2.2.1dev]
  netrc_credential_store C:\Program Files (x86)\Bazaar\plugins\netrc_credential_store [2.5b5]
  news_merge C:\Program Files (x86)\Bazaar\plugins\news_merge [2.5b5]
  pipeline C:\Program Files (x86)\Bazaar\plugins\pipeline [1.4.0]
  qbzr C:\Program Files (x86)\Bazaar\plugins\qbzr [0.22.0dev]
  rewrite C:\Program Files (x86)\Bazaar\plugins\rewrite [0.6.3dev]
  svn C:\Program Files (x86)\Bazaar\plugins\svn [1.1.2]
  upload C:\Program Files (x86)\Bazaar\plugins\upload [1.0.1dev]
  xmloutput C:\Program Files (x86)\Bazaar\plugins\xmloutput [0.8.8]

Related branches

summary: Starting Bazaar explorer the 1st time: GitWorkingTree.inventory
+ AttributeError
Revision history for this message
Alexander Belchenko (bialix) wrote :

I think we need to ask Jelmer for the hint.

affects: bzr-explorer → qbzr
Revision history for this message
Alexander Belchenko (bialix) wrote :

@Jelmer, can you shed some light what's wrong here?

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

qbzr still uses the inventory interface - it should be using Tree methods only.

The attached code moves us one step in the right direction.

However, the code still uses InventoryDirectory.children, which isn't filled in for foreign branches. Instead, we should add something in the bzr Tree API to iterate over children.

Jelmer Vernooij (jelmer)
Changed in qbzr:
status: New → Triaged
status: Triaged → New
Changed in qbzr:
status: New → Confirmed
importance: Undecided → Medium
assignee: nobody → Jelmer Vernooij (jelmer)
status: Confirmed → In Progress
Changed in qbzr:
status: In Progress → Fix Released
milestone: none → 0.22.0
Revision history for this message
Péter Szabó (6030999+launchpad) wrote :

You guys are great!
I was able to apply most of the patch (except the NEWS file) to the qbzr plugin directory and it seems to work now.

Revision history for this message
Alexander Belchenko (bialix) wrote : Re: [Bug 922121] Re: Starting Bazaar explorer the 1st time: GitWorkingTree.inventory AttributeError

Péter Szabó пишет:
> You guys are great!
> I was able to apply most of the patch (except the NEWS file) to the qbzr plugin directory and it seems to work now.

Kudos to Jelmer!

--
All the dude wanted was his rug back

Revision history for this message
IWATA Hidetaka (hid-iwata) wrote :

Now, qannotate does not work with bzr2.5b5.
It seems to be caused by this fix.

Traceback (most recent call last):
  File "D:\DEVELOP\BZR_PLUGINS_25\qbzr\lib\trace.py", line 365, in reports_exception_decorate
    return f(*args, **kargs)
  File "D:\DEVELOP\BZR_PLUGINS_25\qbzr\lib\annotate.py", line 402, in initial_load
    self.path, self.fileId) = self.loader_func(*self.loader_args)
  File "D:\DEVELOP\BZR_PLUGINS_25\qbzr\lib\commands.py", line 268, in _load_branch
    entry = tree.iter_entries_by_dir(specific_file_ids=[file_id])[0]
TypeError: 'generator' object is not subscriptable

Revision history for this message
Alexander Belchenko (bialix) wrote :

Fixing this error is relatively easy:

            entry = list(tree.iter_entries_by_dir(specific_file_ids=[file_id]))[0]

But that in fact produce another error:

  File "C:\work\Bazaar\plugins\qbzr\lib\commands.py", line 269, in _load_branch
AttributeError: 'tuple' object has no attribute 'kind'

It looks like the API has changed significantly. I'll revert this patch for now.

Changed in qbzr:
status: Fix Released → Confirmed
Changed in qbzr:
status: Confirmed → 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.