[MERGE REQUEST] empty revision history buglet fix

Andres Salomon dilinger at athenacr.com
Thu Oct 20 21:01:59 BST 2005


Hi,

While mindlessly upgrading repositories, I got the following error:

starting upgrade from format 4 to 5
note: upgrade may be faster if all store files are ungzipped first
bzr: ERROR: command: '/usr/bin/bzr' 'upgrade'
pwd: /afs/d2702.athenacr.com/users/dilinger/bzr/acr-krb5
list index out of range
  at /usr/lib/python2.4/site-packages/bzrlib/upgrade.py line 163, in
_convert_to_weaves()
  see ~/.bzr.log for debug information


>From bzr.log:

  File "/usr/lib/python2.4/site-packages/bzrlib/upgrade.py", line 120,
in convert
    self._convert_to_weaves()
  File "/usr/lib/python2.4/site-packages/bzrlib/upgrade.py", line 163,
in _convert_to_weaves
    self.to_read = [rev_history[-1]]
IndexError: list index out of range

As it turns out, rev_history was an empty list; this was due to the fact
that I'd done a 'bzr init' (and perhaps a 'bzr add -v .'), but never
actually commited anything to the repository in question.  The fix is
trivial, and simply makes it so that we slice the list instead of
returning a single element.


http://squishy.cc/software/bzr/bzr.dilinger/

revno: 1322
committer: Andres Salomon <dilinger at athenacr.com>
timestamp: Thu 2005-10-20 15:48:56 -0400
message:
  Handle the case where revision_history() returns an empty list during
  an upgrade.  Not a huge problem, since there's really nothing to
convert,
  but it's nice to not spew errors anyways.






More information about the bazaar mailing list