StopIteration in set_state_from_inventory

Bug #757005 reported by Martin Pool
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar
Confirmed
Medium
Unassigned

Bug Description

Running 'bzr repair-workingtree -force' in a branch that's never been committed to fails like so:

mbp@joy% bzr repair-workingtree --force
bzr: ERROR: exceptions.StopIteration:

Traceback (most recent call last):
  File "/home/mbp/bzr/trunk/bzrlib/commands.py", line 923, in exception_to_return_code
    return the_callable(*args, **kwargs)
  File "/home/mbp/bzr/trunk/bzrlib/commands.py", line 1123, in run_bzr
    ret = run(*run_argv)
  File "/home/mbp/bzr/trunk/bzrlib/commands.py", line 688, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/home/mbp/bzr/trunk/bzrlib/commands.py", line 710, in run
    return self._operation.run_simple(*args, **kwargs)
  File "/home/mbp/bzr/trunk/bzrlib/cleanup.py", line 135, in run_simple
    self.cleanups, self.func, *args, **kwargs)
  File "/home/mbp/bzr/trunk/bzrlib/cleanup.py", line 165, in _do_with_cleanups
    result = func(*args, **kwargs)
  File "/home/mbp/bzr/trunk/bzrlib/builtins.py", line 530, in run
    tree.reset_state(revision_ids)
  File "/home/mbp/bzr/trunk/bzrlib/mutabletree.py", line 49, in tree_write_locked
    return unbound(self, *args, **kwargs)
  File "/home/mbp/bzr/trunk/bzrlib/workingtree_4.py", line 1311, in reset_state
    state.set_state_from_scratch(base_tree.inventory, trees, [])
  File "/home/mbp/bzr/trunk/bzrlib/dirstate.py", line 2709, in set_state_from_scratch
    self.set_state_from_inventory(working_inv)
  File "/home/mbp/bzr/trunk/bzrlib/dirstate.py", line 2594, in set_state_from_inventory
    current_new = new_iterator.next()
StopIteration

Revision history for this message
John A Meinel (jameinel) wrote : Re: [Bug 757005] [NEW] StopIteration in set_state_from_inventory

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 04/11/2011 03:11 AM, Martin Pool wrote:
> Public bug reported:
>
> Running 'bzr repair-workingtree -force' in a branch that's never been
> committed to fails like so:
>
>
> mbp@joy% bzr repair-workingtree --force
> bzr: ERROR: exceptions.StopIteration:
>

I believe the code is expecting that you will at least have a root-id.
However, certainly something that could be guarded against.

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk2kHkoACgkQJdeBCYSNAANqIgCgjpBA1qxlMDyeMNB2NOxodR/t
MtIAnii1hXpuSA8wU3x5xuA53RDY9XxE
=gsIa
-----END PGP SIGNATURE-----

Jelmer Vernooij (jelmer)
tags: added: check-for-breezy
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.